Standard reference
TABLE ' Border-collapse ' defines the TD border two modes, when the ' border-collapse ' value is ' collapse ', TD border Merge, the value is ' separate ' when the TD border separation.
' Border-spacing ' is a feature in the TABLE in the TD border separation mode. This attribute represents the distance between the TD borders and, if only one length value is set, represents the horizontal and vertical spaces. If you set two length values, the first value is the horizontal space and the second is the vertical space. The length value cannot be negative.
' CellSpacing ' as a property of the TABLE tag, or you can specify the distance between cells.
Detailed description of TABLE border mode in the CSS2.1 specification: 17.6 Borders.
Detailed description of the ' border-spacing ' feature in the CSS2.1 specification: 17.6.1 border-spacing.
Detailed description of ' cellspacing ' in the HTML 4.01 specification: 11.3.3 cellspacing.
Problem description
In TABLE TD border mode is detached mode, when defining ' border-spacing ', IE6 IE7 IE8 (Q) does not support this property, other browsers conform to the specification.
The impact
When this property is set, the page layout difference is caused because the property is not supported in IE6 IE7 IE8 (Q).
The affected browser
IE6 IE7 IE8 (Q)
Problem analysis
In TABLE TD border mode is the detach mode, define the ' border-spacing ' code as follows:
Visible
IE6 IE7 IE8 (Q) does not support this property.
IE8 (S) Firefox Chrome Safari Opera supports this property and conforms to the specification.
So what's the difference between cellspacing and border-spacing in terms of layout? Then analyze the following code:
<! DOCTYPE html>
Each browser behaves consistently:
Visible, cellspacing is equivalent to border-spacing setting the same value in both horizontal and vertical directions.
Solution Solutions
' Border-spacing ' is not a good support for all browsers, and if the horizontal and vertical spaces are equal, you can replace the ' border-spacing ' feature with the CellSpacing property of TABLE.