Note: These options are only viewable with MS Internet Explorer 4.x
Frame Attributes Can be set by Cell:
box, void, above, below, left hand side, right hand side, horizontal borders, vertical borders
Cellpadding and Cellspacing
By default, browsers tend to pack things into tables as closely as
possible. Sometimes, things get a little too close, with just a pixel or
two of space between adjacent cells. HTML provides two
<table> attributes to control table spacing:
cellspacing and cellpadding.
Cellspacing is the space between cells, and between cells and the outer
edge of the table. When you change the cellspacing, cells
get further apart, and the table border expands to provide more space
around the table.
Cellpadding is the space between the contents of a cell and the edge of
a cell. When you increase the cellpadding, cells get
larger, but the space between cells (and between cells and the table
border) stays the same.
The easiest way to see this is to revisit our sample table. Here it is,
with the cellpadding increased to 10 pixels (we did this by
using <table border=1 cellpadding=10>):
| |
Oranges |
Grapefruit |
| Flavor |
Sweet |
Tart |
| Size |
Small |
Large |
Contrast this with 10 pixels of cellspacing (created by
specifying <table border=1 cellspacing=10>):
| |
Oranges |
Grapefruit |
| Flavor |
Sweet |
Tart |
| Size |
Small |
Large |
This makes the difference much more obvious: cellpadding
makes the cells bigger, while cellspacing makes the spaces
between the cells, and the borders, bigger.