Warning: include(http://www.studio6000.com/header.htm) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/studio60/public_html/html/lesson15d.php on line 12

Warning: include() [function.include]: Failed opening 'http://www.studio6000.com/header.htm' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/studio60/public_html/html/lesson15d.php on line 12

Warning: include(http://www.studio6000.com/tutorside.htm) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/studio60/public_html/html/lesson15d.php on line 17

Warning: include() [function.include]: Failed opening 'http://www.studio6000.com/tutorside.htm' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/studio60/public_html/html/lesson15d.php on line 17
 

Aligning the text within a cell

You can control where the text within a cell will appear horizontally and vertically.

By default the text in a cell will be aligned left.  Meaning, if you  do not specify how to align it it will automatically be aligned left, like so:

<body>
<table width="100" height="100" border="1">
<tr>
<td>Text1 </td>
</tr>
</table>
</body>

 

Text1

To align the text right simply insert the align attribute within the opening cell tag (<td>), like so:

<body>
<table width="100" height="100" border="1">
<tr>
<td align="right">Text1 </td>
</tr>
</table>
</body>

Text1

To center the text simply insert align="center"  within the opening cell tag (<td>), like so:

<body>
<table width="100" height="100" border="1">
<tr>
<td align="center" >Text1 </td>
</tr>
</table>
</body>

Text1

To align the text vertically we use a similar attribute. 

<body>
<table width="100" height="100" border="1">
<tr>
<td valign="top" >Text1 </td>
</tr>
</table>
</body>

Text1

<body>
<table width="100" height="100" border="1">
<tr>
<td valign="bottom" >Text1 </td>
</tr>
</table>
</body>

Text1

<body>
<table width="100" height="100" border="1">
<tr>
<td valign="middle" >Text1 </td>
</tr>
</table>
</body>

Text1

By default the text will be vertically aligned in the middle. Meaning, if you insert the attribute valign="middle" it is the equivalent of inserting nothing.

Next Lesson


Warning: include(http://www.studio6000.com/footer.htm) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/studio60/public_html/html/lesson15d.php on line 130

Warning: include() [function.include]: Failed opening 'http://www.studio6000.com/footer.htm' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/studio60/public_html/html/lesson15d.php on line 130