The table starts with the <table> tag and ends with </table>
New Rows are Created with the tags <tr> and </tr>
And Columns, are created with the tags <td> and </td>
What does TR and TD Stand for?
TR = Table Row
TD = Table Data
Here is a simple example of a table
- Code: Select all
<table>
<tr>
<td>
Row 1, Col 1
</td>
<td>
Row 1, Col 2
</td>
</tr>
<tr>
<td>
Row 2, Col 1
</td>
<td>
Row 2, Col 2
</td>
</tr>
</table>
^^^ Will display something like,
Row 1, Col 1 Row 1, Col 2
Row 2, Col 2 Row 2, Col 2
Now that's the basics of tables, however there is a bit more.
The table tag has 3 very useful attributes
cellspacing, cellpadding, and border.
By default cellspacing and cellpadding = 1
And in old browsers the default of border = 1
For formatting reasons you may want to change the cellspacing, cellpadding, and border to 0.
Enjoy!


