Tachyons: Add a .collapse class for table styling

Created on 10 May 2016  路  1Comment  路  Source: tachyons-css/tachyons

In order to avoid the spacing between <td> elements when applying borders it'd be nice to have something similar to the following:

.collapse {
  border-collapse: collapse;
  border-spacing: 0;
}

So I can then make a bordered table with:

<table class="w-100 collapse">
  <thead>
    <tr>
      <th class="tl bb b--light-gray bw2 pa2">#</th>
      <th class="tl bb b--light-gray bw2 pa2">First Name</th>
      <th class="tl bb b--light-gray bw2 pa2">Last Name</th>
      <th class="tl bb b--light-gray bw2 pa2">Username</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row" class="tl bb b--light-gray pa2">1</th>
      <td class="tl bb b--light-gray pa2">Fred</td>
      <td class="tl bb b--light-gray pa2">Flintstone</td>
      <td class="tl bb b--light-gray pa2">freddybooboo</td>
    </tr>
  </tbody>
</table>

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johno picture johno  路  6Comments

shivekkhurana picture shivekkhurana  路  6Comments

tabeth picture tabeth  路  4Comments

FateRiddle picture FateRiddle  路  3Comments

johno picture johno  路  3Comments