HTML

Tables - Headers, Cellpadding, Cellspacing & Nesting

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.

Image of button   Table Basics
Image of button   Alignment, width, height
Image of button   Arranging Information and Images
Image of button   Organising Forms

Back to top     Home     Serious Stuff

© 2001. Copyright Sue Nethercott.