Software Sue

Link to Simply Sue
Link to Sustainability Sue
location: software/markup/html/tables/headers etc. Skip navigation : Home  

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 3Top 4Top 5Top 6
Side11234
Side2 56 78
9101112

Borders

You can change the borders of your table by using (or omitting) the BORDER attribute.

No border
A1 A2
A3 A4
Default
B1 B2
B3 B4
BORDER = 2
C1 C2
C3 C4
BORDER = 5
D1 D2
D3 D4
BORDER = 10
E1 E2
E3 E4

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
A default
8 0
2
B default
0 8
3
C default
8 8
4
D 5
8 8
5
E default
0 0

Nesting Tables

The above 2 examples also show how tables can be nested within tables.