Nesting Tables
Now that we have covered the basics within HTML
; we have looked at colors, cells, and tables...ahh...tables, yes, and now we are going to
look at what is known as
nesting tables.
Nesting tables is when you create tables to reside within each other. You could have a main
table that contains 2, 3, 4 or as many tables as you want inside of it.
"Why would I want to do this?" you ask
Sometimes it is the only way to get data or content into the specific format
that you or your client is trying to achieve.
To start off simply, we will build a single table that is 400 pixels wide and 300 pixels
tall, and to make it a little easier visually, we are going to color it orange and add a
piece of text inside it that says "Table 1".
Code for orange table:
|
<Table bgcolor="orange" width="400" height="300">
<tr>
<td>
Table 1
</td>
</tr>
</table>
|
The code above sets up a table and then creates a main row and cell within it.
The code would be viewed as below: