CSS Attribute Table
Table for CSS attributes)
HTML defines three elements for a table to group rows. These elements are thead (header), tbody (Table body), and tfoot (footer ).
In HTML4, The tfoot in the document structure must appear before the tbody. HTML5 removes this restriction.
If no group element is written in the source code, the browser automatically creates the tbody, so the selector table> tr is always invalid because there is a tbody in the middle.
If each row in the table body starts with a td element, the th is the row title.
Colgroup and col
<Colgroup> labels can only be used in table elements.
<Col> labels can only be used in table or colgroup elements.
Col can be used outside colgroup.
The col in colgroup overwrites the colgroup style.
Table-layout: auto | fixed
Auto: the default automatic algorithm. The layout is based on the content of each cell. In other words, you may define a cell with a width of PX, but the result may not be PX. The table is displayed after each cell is read and computed, and the speed is very slow.
Fixed: fixed Layout Algorithm. In this algorithm, the horizontal layout is only based on the table width, the table Border width, cell spacing, and column width, but is not related to the table content. That is to say, the content may be cropped.
Border-collapse: separate | collapse
Separate: The border is independent.
Collapse: adjacent edges are merged.
Border-spacing and empty-cells work only when the table border is independent (that is, when the border-collapse attribute is set to separate.
Border-spacing: <length> {1, 2}
The length value is used to define the horizontal and vertical spacing between the row and cell borders. Negative values are not allowed.
If two length values are provided, the first applies to the horizontal spacing, and the second applies to the Vertical spacing.
If only one length value is provided, this value acts on the horizontal and vertical spacing.
Caption-side: top | bottom
Top: Specify the caption on the top of the table.
Bottom: Specify the caption under the table.
Empty-cells: hide | show
Set or retrieve whether to display the cell border when the table cell has no content.
Hide: Specifies to hide the border of a table cell when the table cell contains no content.
Show: Specify to display the border of the cell when the cell in the table has no content.