A table shows information in columns and rows.
Tables help logically organize information and group like things together, and they make it easier to understand complex content, as explained on plainlanguage.gov. They’re especially useful for showing long lists of sequential or structured content. Users read tables one row or column at a time, making it easy to digest and compare information.
Tables also help users find specific information within a large data set. For example, if someone is looking for how much their tax is based on their income for a particular year, it’s much easier to find the intersection of that year and income range than to scan or read an entire paragraph of text.
When to use
Displaying tabular data. When you need to display tabular information, such as statistical data.
Displaying directories. When listing locations or resources that have similarly structured content for many items.
Anatomy
1. Table Header (required)
Describes the information types in the columns below. There should be 2 or more columns to warrant a tabular display.
2. Table Row (required)
Alternate between white and gray for readability. There should be 2 or more rows to warrant a tabular display.
3. Sort
This interactive element can be next to any column label in the header to indicate the table can be sorted by that type of data. The whole cell is clickable and sorts by the column in descending order on click. Continue to click on the cell to toggle between descending (down arrow) and ascending (up arrow).
4. Subtotal / Blue Highlight Row
5. Total / Yellow Highlight Row
Examples
<table class="ucla-table">
<thead>
<tr>
<th>Title</th>
<th>Title</th>
<th>Title</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Footer</th>
<th>Footer</th>
<th>Footer</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><strong>Lorem Ipsum</strong></td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
<tr class="ucla-is-gold">
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr class="ucla-is-blue">
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
</tbody>
</table>
<table class="ucla-table ucla-table__border">
<thead>
<tr>
<th>Title</th>
<th>Title</th>
<th>Title</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Footer</th>
<th>Footer</th>
<th>Footer</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
<tr class="ucla-is-gold">
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr class="ucla-is-blue">
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
</tr>
</tbody>
</table>
<div class="ucla-table__responsive">
<table class="ucla-table ucla-table__sort">
<thead>
<tr>
<th class="ucla-sortable" aria-sort="none">
Title
<svg
class="sort-default"
viewBox="0 0 8 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.42857 4.14287L4 0.714294L0.571427 4.14287L7.42857 4.14287Z"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.571426 5.85715L4 9.28572L7.42857 5.85715L0.571426 5.85715Z"
/>
</svg>
</th>
<th class="ucla-sortable" aria-sort="none">
Title
<svg
class="sort-default"
viewBox="0 0 8 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.42857 4.14287L4 0.714294L0.571427 4.14287L7.42857 4.14287Z"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.571426 5.85715L4 9.28572L7.42857 5.85715L0.571426 5.85715Z"
/>
</svg>
</th>
<th class="ucla-sortable" aria-sort="none">
Title
<svg
class="sort-default"
viewBox="0 0 8 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.42857 4.14287L4 0.714294L0.571427 4.14287L7.42857 4.14287Z"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.571426 5.85715L4 9.28572L7.42857 5.85715L0.571426 5.85715Z"
/>
</svg>
</th>
<th class="ucla-sortable" aria-sort="none">
Title
<svg
class="sort-default"
viewBox="0 0 8 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.42857 4.14287L4 0.714294L0.571427 4.14287L7.42857 4.14287Z"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.571426 5.85715L4 9.28572L7.42857 5.85715L0.571426 5.85715Z"
/>
</svg>
</th>
<th class="ucla-sortable" aria-sort="none">
Date
<svg
class="sort-default"
viewBox="0 0 8 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.42857 4.14287L4 0.714294L0.571427 4.14287L7.42857 4.14287Z"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.571426 5.85715L4 9.28572L7.42857 5.85715L0.571426 5.85715Z"
/>
</svg>
</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Footer</th>
<th>Footer</th>
<th>Footer</th>
<th>Footer</th>
<th>Footer</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>100</td>
<td>Nome 221</td>
<td>ABCASD</td>
<td>D</td>
<td data-timestamp="1671667200">22/12/2022</td>
</tr>
<tr>
<td>99</td>
<td>Nome 12</td>
<td>AACASD</td>
<td>C</td>
<td data-timestamp="1671840000">24/12/2022</td>
</tr>
<tr>
<td>300</td>
<td>Nome 222</td>
<td>AcCASD</td>
<td>A</td>
<td data-timestamp="1671494400">20/12/2022</td>
</tr>
<tr>
<td>400</td>
<td>Nome 22</td>
<td>AcdCASD</td>
<td>B</td>
<td data-timestamp="1702857600">18/12/2023</td>
</tr>
<tr>
<td>10</td>
<td>Nome 11</td>
<td>cCASD</td>
<td>A</td>
<td data-timestamp="1672012800">26/12/2022</td>
</tr>
</tbody>
</table>
</div>
<div class="ucla-table__responsive">
<table class="ucla-table ucla-table__border">
<thead>
<tr>
<th>Title</th>
<th>Title</th>
<th>Title</th>
<th>Title</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Footer</th>
<th>Footer</th>
<th>Footer</th>
<th>Footer</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
<td>Lorem Ipsum</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
<td>Nulla et malesuada</td>
</tr>
<tr class="ucla-is-gold">
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
<td>Nulla et malesuada</td>
</tr>
<tr class="ucla-is-blue">
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
<td>Nulla et malesuada</td>
</tr>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
<td>Nulla et malesuada</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
<td>Nulla et malesuada</td>
</tr>
<tr>
<td>Lorem Ipsum</td>
<td>dolor sit amet</td>
<td>consectetur adipiscing elit</td>
<td>Nulla et malesuada</td>
</tr>
<tr>
<td>Nulla et malesuada</td>
<td>Proin eu mattis justo</td>
<td>Nulla cursus augue elementum</td>
<td>Nulla et malesuada</td>
</tr>
</tbody>
</table>
</div>
Best Practices
Left-align table content like text and dates for easy readability.
Right-align complex numerical and financial data for scale of size.
Display headings at the top of each column (required).
Consider whether to define row headings for added emphasis to each line of data (optional).
Alternate every other row with light and dark fill to make the information more readable.
Use blue and gold fill to highlight subtotals and totals.