What is border-collapse?

QuestionsQuestions8 SkillsProCSS Styling TablesOct, 22 2025
0133

border-collapse is a CSS property used in tables to specify whether the borders of the table and its cells should be collapsed into a single border or separated into distinct borders. It can take two values:

  1. collapse: This value merges the borders of adjacent table cells into a single border. This is the default behavior for tables.
  2. separate: This value keeps the borders of adjacent cells separate, allowing for distinct borders around each cell.

Here's an example of how to use it in CSS:

table {
    border-collapse: collapse; /* or 'separate' */
}

Using border-collapse: collapse; can create a cleaner look for tables by reducing the visual clutter of multiple borders.

0 Comments

no data
Be the first to share your comment!