Tables
TailwindProvides a set of styles for native HTML table elements.
Stylesheets
Package
Source
Docs
Examples
Position | Name | Symbol | Weight |
---|---|---|---|
1 | Hydrogen | H | 1.0079 |
2 | Helium | He | 4.0026 |
3 | Lithium | Li | 6.941 |
4 | Beryllium | Be | 9.0122 |
5 | Boron | B | 10.811 |
Total Weight | 31.7747 |
Usage
Use a wrapping .table-container
element around a table with the class .table
applied to create a responsive table.
<div class="table-container">
<table class="table table-hover">
<thead>
<tr>
<th>Position</th>
<th>Name</th>
<th>Symbol</th>
<th>Weight</th>
</tr>
</thead>
<tbody>
{#each tableArr as row, i}
<tr>
<td>{row.position}</td>
<td>{row.name}</td>
<td>{row.symbol}</td>
<td>{row.weight}</td>
</tr>
{/each}
</tbody>
<tfoot>
<tr>
<th colspan="3">Calculated Total Weight</th>
<td>{totalWeight}</td>
</tr>
</tfoot>
</table>
</div>