HTML Table Attributes
Before CSS flexbox and grid, HTML tables ruled the web layout. Attributes like border, cellpadding, and cellspacing were the primary tools for design.
The Big Three Attributes
To control the table's appearance directly in HTML, we use specific attributes on the <table> tag:
- border: Defines the thickness of the frame around the table and cells.
- cellpadding: Defines the whitespace between the cell edge and cell content.
- cellspacing: Defines the whitespace between cells.
Merging Cells
Data isn't always uniform. Sometimes a header needs to span multiple columns, or a side label needs to span multiple rows. We use colspan="n" to merge horizontally and rowspan="n" to merge vertically.
View Full Transcript+
This section contains the detailed transcript regarding legacy HTML table attributes. It covers the implementation of border="1", cellpadding for internal spacing, and cellspacing for external spacing. It also covers rowspan and colspan usage for complex data representation.
