Border collapse

noun

say it: “BOR-der kuh-LAPS” /ˈbɔrdər kəˈlæps/

The CSS property that decides how the borders of a table's neighboring cells meet: kept apart, so each line is drawn twice with a gap between, or collapsed, so each pair merges into one line.

What does border-collapse do?

By default every table cell draws its own border, so two neighbors show two lines with a gap between them. border-collapse: collapse on the <table> merges them into one line, which is how most tables you see are drawn.

table { border-collapse: collapse; }
th, td {
  border: 1px solid #cccccc;
  padding: 0.5rem;
}

In a sentence

  • “Every line in my price table was doubled until I set border-collapse to collapse on the table.”
  • “With border-collapse: collapse, the lines between the rows of the schedule are single and clean.”

Level: Apprentice · More CSS terms at this level

Updated