CSS border-collapse

The CSS border-collapse property sets whether table borders should collapse into a single border or be separated with a gap.

There are two possible values for the border-collapse property:

Let's see some examples to understand how the border-collapse property works:

Result:
Cell 1 Cell 2
Cell 3 Cell 4

In the example above, the table is using the default value which is separate. You can see that there is a visible gap between the table cells.

Now, let's see how the table looks when we use the border-collapse: collapse; property:

Result:
Cell 1 Cell 2
Cell 3 Cell 4

With border-collapse: collapse;, the borders of the table cells collapse into a single border, giving a cleaner look to the table.

Remember to apply the border-collapse property to your tables to control how the borders should be displayed.