HTML tables
headers, borders (cellpadding, cellspacing), nesting
Note. These pages have not been upgraded from HTML to XHTML
View source to see the code
Headers
You can also add headers to the tops of your columns and the sides of your rows. You can have multiple headers, with the help of COLSPAN and ROWSPAN.
| | Top 1 | Top 2 |
| | Top 3 | Top 4 | Top 5 | Top 6 |
| Side1 | 1 | 2 | 3 | 4 |
| Side2 |
5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 |
Borders
You can change the borders of your table by using (or omitting) the BORDER attribute.
| No border
|
Default
|
BORDER = 2
|
BORDER = 5
|
BORDER = 10
|
Use the CELLPADDING attribute to specify the number of pixels to be left around the text, and CELLSPACING for the number of pixels between cells.
Contents
| Table |
Border |
| padding |
spacing |
|
1
|
2
|
3
|
4
|
5
|
Nesting Tables
The above 2 examples also show how tables can be nested within tables.