Table layout

Utilities for controlling the table layout algorithm


Class reference

ClassProperties
table-autotable-layout: auto;
table-fixedtable-layout: fixed;

# Auto

Use .table-auto to allow the table to automatically size columns to fit the contents of the cell.

TitleAuthorViews
Intro to CSSAdam858
A Long and Winding Tour of the History of UI Frameworks and Tools and the Impact on DesignAdam112
Intro to JavaScriptChris1,280
<table class="table-auto">
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>Views</th>
</tr>
</thead>
<tbody>
<tr>
<td>Intro to CSS</td>
<td>Adam</td>
<td>858</td>
</tr>
<tr class="bg-green-100">
<td>A Long and Winding Tour of the History of UI Frameworks and Tools and the Impact on Design</td>
<td>Adam</td>
<td>112</td>
</tr>
<tr>
<td>Intro to JavaScript</td>
<td>Chris</td>
<td>1,280</td>
</tr>
</tbody>
</table>

# Fixed

Use .table-fixed to allow the table to ignore the content and use fixed widths for columns. The width of the first row will set the column widths for the whole table.

You can manually set the widths for some columns and the rest of the available width will be divided evenly amongst the columns without explicit width.

TitleAuthorViews
Intro to CSSAdam858
A Long and Winding Tour of the History of UI Frameworks and Tools and the Impact on DesignAdam112
Intro to JavaScriptChris1,280
<table class="table-fixed">
<thead>
<tr>
<th class="w-1/2 ...">Title</th>
<th class="w-1/4 ...">Author</th>
<th class="w-1/4 ...">Views</th>
</tr>
</thead>
<tbody>
<tr>
<td>Intro to CSS</td>
<td>Adam</td>
<td>858</td>
</tr>
<tr class="bg-blue-100">
<td>A Long and Winding Tour of the History of UI Frameworks and Tools and the Impact on Design</td>
<td>Adam</td>
<td>112</td>
</tr>
<tr>
<td>Intro to JavaScript</td>
<td>Chris</td>
<td>1,280</td>
</tr>
</tbody>
</table>