# Border collapse

> Utilities for controlling whether table borders should collapse or be separated.

Source: https://www.zenplates.co/documentation/utilities/border-collapse/ (Utilities › Tables)

| Class              | Properties                   |
| ------------------ | ---------------------------- |
| `.border-collapse` | `border-collapse: collapse;` |
| `.border-separate` | `border-collapse: separate;` |

## Usage

Use `.border-collapse` to combine adjacent cell borders into a single border when possible, including the borders on the top-level `<table>` tag.

```html
<table class="table table-bordered border-collapse">
  <tr>
    <th class="border">First name</th>
    <th class="border">Last name</th>
  </tr>
  <tr>
    <td class="border">John</td>
    <td class="border">Doe</td>
  </tr>
  <tr>
    <td class="border">Jane</td>
    <td class="border">Doe</td>
  </tr>
</table>
```

This behavior is applied by default as part of the theme's base styles.

Use `.border-separate` to force each cell to display its own separate borders.

```html
<table class="table table-bordered border-separate">
  <tr>
    <th class="border">First name</th>
    <th class="border">Last name</th>
  </tr>
  <tr>
    <td class="border">John</td>
    <td class="border">Doe</td>
  </tr>
  <tr>
    <td class="border">Jane</td>
    <td class="border">Doe</td>
  </tr>
</table>
```

## Variants

By default, no responsive or hover-state variants are generated for border collapse utilities.

### Responsive

To include responsive variants like `.md:border-separate`, add `"border-collapse"` to the `$responsive-variants` variable in your theme's `_variables.scss` file when [recompiling your CSS](https://www.zenplates.co/documentation/customization/using-sass-source-files):

```scss
$responsive-variants: (
  // ...
  "border-collapse",
);
```

### Hover-state

To include hover-state variants like `.hover:border-separate`, add `"border-collapse"` to the `$hover-variants` variable:

```scss
$hover-variants: (
  // ...
  "border-collapse",
);
```
