Rows = <tr></tr> & Columns = <td></td>
First you must start by telling the browser that you are going to be using a table:
<table></table>
Always work tags in pairs and don't forget to format!!!
Use <tr></tr> for each row and <td></td> for each column. Even when you only have one row with nothing in it, it still has one column in it.
Example - One row:
<table>
<tr>
<td> </td>
</tr>
</table>
Example - Two rows, three columns
<table>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
It is always best to sit down with a piece of paper and draw out your table structure before you try to code it. Especially when you want something more complicated.
Example:
<table>
<tr>
<td rowspan="2"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
rowspan=" "
The blue section shows a cell that spans or covers two rows. To accomplish this, you use the rowspan="2" command in the <td> tag, with the 2 being the number of rows you want your cell to cover or span.
colspan=" "
The pink section shows a cell that spans or covers three columns. To accomplish this, you use the colspan="2" command in the <td> tag, with the 3 being the number of columns you want your cell to cover or span.
|