Explain the usage of “table-layout” property

Technology CommunityCategory: CSSExplain the usage of “table-layout” property
VietMX Staff asked 3 years ago

The table-layout property defines the algorithm used to lay out table cells, rows, and columns.

table-layout: auto|fixed|initial|inherit;
  • auto – Browsers use an automatic table layout algorithm. The column width is set by the widest unbreakable content in the cells. The content will dictate the layout.
  • fixed – The layout is fixed based on the first row. Set the width of those, and the rest of the table follows. If no widths are present on the first row, the column widths are divided equally across the table, regardless of content inside the cells.
  • initial – Sets this property to its default value.
  • inherit – Inherits this property from its parent element.