Dev Helpers
← Back

Align numeric table cells to the end

Align numeric table cells to the end with Tailwind CSS 4 utilities. The preview uses precompiled styles.

Open this example in the interactive library

Source code

<table class="demo [&_td:last-child]:text-end [&_td]:py-1 [&_td]:px-3">
  <caption>
    Monthly totals
  </caption>
  <tbody>
    <tr>
      <td>July</td>
      <td>100</td>
    </tr>
    <tr>
      <td>August</td>
      <td>8</td>
    </tr>
  </tbody>
</table>