Tables
are used on websites for two major purposes:
–The obvious purpose of arranging information in a
table
–The less obvious - but more widely used - purpose of creating a
page layout with the use of hidden tables.
••The
<table> tag is used to begin a table. Within a table element are the <tr>
(table rows) and <td> (table columns) tags. Tables are a handy way to
create a site's layout, but it does take some getting used to.
HTML Code:
•<table
border="1">
•<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>
Cell Padding and Spacing
•With
the cellpadding and cellspacing attributes you will be
able to adjust the white space on your tables. Spacing defines the width of the
border, while padding represents the distance between cell borders and the
content within. Color has been added to the table to emphasize these attributes.
•HTML Code:
•<table
border="1" cellspacing="10"
bgcolor="rgb(0,255,0)">
bgcolor="rgb(0,255,0)">
•<tr>
•<th>Column
1</th>
• <th>Column
2</th>
•</tr>
• <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>
0 comments:
Post a Comment