silversailoruni
05-04-2003, 11:11 PM
Hi everyone! I looked at Lissa's tables section, but didn't understand, and didn't know what to put in the search so here's my question: How do you make a tables layout? I'm so new at this, and I'm confused about it. So if some one can help me please do! Some one told me a tables layout was the way to go for beginners, so that's why I'm asking.
Elentari
05-04-2003, 11:35 PM
Well......there's really no easier way to explain how to make a table then the way Lissa explains it but I'll try.
Now.....
To create a table you have the 3 basic parts.
<table> - the table tag that opens and closes the table
<tr> - table row tag - however many horizontal rows you want
<td> - table cells - however many you want horizontally per row, all your content goes here....
so...lets say you want a table that has 3 cells horizontally side by side by size.....the code would look like this
<table>
<tr>
<td> CELL ONE</td>
<td> CELL TWO </td>
<td> CELL THREE </td>
</tr>
</table>
Explanation: Obviously you only need one row <tr> and three cells <td> side by side.
so you open with your table tag.....then your tr tag.........then within it you put your three cells. make sure you close the </td> afterwards and then when you're put your three cells, you close your row </tr> and your table and tada.
Hope that helped.
Obviously if you want more horizontal rows with more cells you add after that another <tr> tag and put in your cells there. The rows have to have the same amount of cells but if you want one row with 3 cells and the second row with only one, you have to add the colspan tag to the <td> tag of the cell you want to stretch the whole row. basically it would look like the following
<table>
<tr>
<td> CELL ONE</td>
<td> CELL TWO </td>
<td> CELL THREE </td>
</tr>
<tr>
<td colspan=3>CELL IN 2ND ROW THAT FILLS THE ROW</td>
</tr>
</table>