We can specify cell spacing within a table. The property is called cell spacing (cell spacing as an attribute of the TABLE element).
Cell spacing refers to: Cell spacing is the space between the border on the inside of one cell and the border on the inside of the next cell or the outside border of the table.
When you classify borders, borders are actually around each cell, and a separate border is around the entire table. If the borders are thin and there is no cell spacing, it will look like it is one line that encloses the cells and attaches to the border around the table. The more cell spacing you define, the clearer it will be that these are separate lines.
The previous table has no cell spacing.
The previous table has cell spacing. The spacing attribute is defined as part of the
TABLE element as follows:
<TABLE cellspacing=”3”>
Or, as part of a style sheet:
TABLE {
cellspacing: 3
}
Amateur to CSS2, you can specify different values for horizontal space between cells and for vertical space between cells.
>The first value supplied to the cellspacing property is for horizontal cell spacing;
> The second is for vertical cell spacing.
If you provide only one, it applies to both kinds of cell spacing.
Also new to CSS2, you can collapse borders, removing the cell spacing altogether. This makes your table look more like the way a table appears in a word-processing document.
The property is called border-collapse. This applies only to table elements: TABLE, COLGROUP, COL, THEAD, TFOOT, TBODY, TR, TH, and TD.
TABLE {
border-collapse: collapse;
}
The default value of border-collapse is separate. You can choose between the keywords
collapse and separate.