Nearby lessons

58 of 71

📊 Tailwind CSS - Tables (Collapse, Spacing, Layout & Caption)

📖 Overview

Table utilities control border behavior, cell spacing, layout algorithms, and caption positioning for HTML tables.

📏 Border Collapse

Control whether table borders are collapsed or separated:

  • border-collapse (default) – Collapses adjacent borders into a single border.
  • border-separate – Keeps adjacent borders separate.
Example02
Loading editor…

↔️ Border Spacing

Control the spacing between table borders (only works with border-separate):

  • border-spacing-0, border-spacing-2, border-spacing-4
  • Axis specific: border-spacing-x-4, border-spacing-y-4
Example03
Loading editor…

📐 Table Layout

Control the table layout algorithm:

  • table-auto (default) – Column widths are based on cell content.
  • table-fixed – Column widths are based on the table's width and the width of the first row cells.
Example04
Loading editor…

📍 Caption Side

Control the position of a table's caption:

  • caption-top (default)
  • caption-bottom
Example05
Loading editor…

🧠 Test Your Knowledge

3 Questions
Progress: 0 / 3