HTML Project 04 Creating Tables in A Web Site
HTML Project 04 Creating Tables in A Web Site
Site
HTML Project 04
Table Example
<table border="1">
<tr>
<th>Color</th>
<th>Style</th>
<th>Size</th>
</tr>
Color Style Size
Blue Shirt Medium
White Dress Small
<tr>
<td>Blue</td>
<td>Shirt</td>
<td>Medium</td>
</tr>
<tr>
<td>White</td>
<td>Dress</td>
<td>Small</td>
</tr>
</table>
<table border="1">
<tr>
Color Style Size
<th>Color</th>
<th>Style</th> Blue Shirt Medium
<th>Size</th>
</tr> White Dress Small
<tr>
<td>Blue</td>
<td>Shirt</td>
<td>Medium</td>
</tr>
<tr>
<td>White</td>
<td>Dress</td>
<td>Small</td>
</tr>
</table>
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2
<table>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
Table Alignments
Horizontal Vertical
Alignment Alignment
Table Left Center
Table Data Cell <td> Left Center
Table Heading Cell <th> Center Center
Defaults:
If you insert the alignment attribute in the table row
element, both the <td> and <th> tag will inherit the
alignment setting from the <tr> element thus
eliminating having to repeat the alignment attribute in
those tags.
Use the valign attribute to change the default from
If
a WIDTH attribute is only set in the
TABLE element, most browsers apportion
column widths equally so their sum is
equal to the table width.
Equal column width
<table cols=″5″ width=″100%″>
Default width = 100% Each column width = 20%