Original article: how to display the border when the TD content in the table is empty
1111111111111
Directory
- Definition and usage
- Instance
- Browser support
- Possible Value
- Definition and usage
- Description
- Instance
- Browser support
- Possible Value
- Related Pages
1. Add:Border-collapse: collapse;
Add:Empty-cells: show;
2. The simplest thing is to write an & nbsp; In TD;
Note:
Border-collapseSet or retrieve whether the row and cell edge of the table are merged or separated according to the standard HTML style.
Definition and usage
The border-collapse attribute sets whether the border of the table is merged into a single border or displayed separately as in standard HTML.
Default Value: |
Separate |
Yes |
Css2 |
Object. style. bordercollapse = "collapse" |
Instance
Set the merge border model for the table:
border-collapse:collapse; }
Browser support
All mainstream browsers support the border-collapse attribute.
Note: any version of Internet Explorer (including IE8) does not support the attribute value "inherit ".
NOTE: If not specified! Doctype, then border-collapse may produce unexpected results.
Possible Value
Description |
Default value. Borders are separated. The border-spacing and empty-cells attributes are not ignored. |
If possible, the border is merged into a single border. The border-spacing and empty-cells attributes are ignored. |
Specify that the value of the border-collapse attribute should be inherited from the parent element. |
Empty-cells:
Definition and usage
The empty-cells attribute sets whether to display empty cells in the table (only used in "split border" mode ).
Note: Some versions of IE browsers do not support this attribute.
Description
This attribute defines how table cells that do not contain any content are represented. If it is displayed, the border and background of the cell are drawn. This attribute is ignored unless border-collapse is set to separate.
Default Value: |
Show |
Yes |
Css2 |
Object. style. emptycells = "hide" |
Instance
Hide the border and background of the empty cells in the table:
table { border-collapse:separate; empty-cells:hide;
}
Browser support
All browsers support the empty-cells attribute.
NOTE: If specified! Doctype, Internet Explorer 8 (and later) supports the empty-cells attribute.
Possible Value
Description |
Borders are not drawn around empty cells. |
Draw borders around empty cells. Default value. |
Specifies that the value of the empty-cells attribute should be inherited from the parent element. |