Utilities for controlling whether table borders should collapse or be separated.
| Class | Styles |
|---|---|
border-collapse |
border-collapse: collapse; |
border-separate |
border-collapse: separate; |
Use the border-collapse utility to combine adjacent cell borders into a single border when possible:
Note that this includes collapsing borders on the top-level <table> tag.
Use the border-separate utility to force each cell to display its own separate borders:
Prefix a border-collapse utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<table class="border-collapse md:border-separate ..."> <!-- ... --> </table>
Learn more about using variants in the variants documentation.
© Tailwind Labs Inc.
https://tailwindcss.com/docs/border-collapse