Tables
The tables pattern is for displaying text-based content within tables.
Rules for tables
- Tables must not be used for more than two columns.
- If your content requires more than two columns use the DataTables pattern for more complex datasets as they offer a responsive solution.
- Tables must include a
table-striped
class on the table element to add a background colour to alternate rows—this aids readability. - You must only use text-based content within tables.
Colour headings
You also have the option of other colours for the table header. Secondary and tertiary table headers are used on pages currently using the secondary and tertiary palette themes.
For further reference on colour palettes, see the colours page.
Options available
Default table heading
Email address | Name |
---|---|
example@st-andrews.ac.uk | Tony Stark |
example@st-andrews.ac.uk | Steven Rogers |
example@st-andrews.ac.uk | Bruce Banner |
Code
Example
<!-- Begin pattern: tables //-->
<table class="table table-striped">
<thead>
<tr>
<th>Email address</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>example@st-andrews.ac.uk</td>
<td>Tony Stark</td>
</tr>
<tr>
<td>example@st-andrews.ac.uk</td>
<td>Steven Rogers</td>
</tr>
<tr>
<td>example@st-andrews.ac.uk</td>
<td>Bruce Banner</td>
</tr>
</tbody>
</table>
<!-- End pattern: tables //-->
Primary table heading
Class | Description |
---|---|
.table-primary |
Primary palette colour, to be used on all pages using the primary palette theme. |
.table-secondary |
Secondary palette colour, to be used on all pages using the secondary palette theme. |
.table-tertiary-1 |
First tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-2 |
Second tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-3 |
Third tertiary palette colour, to be used on all pages using the tertiary palette theme. |
Code
Example
<!-- Begin pattern: tables //-->
<table class="table table-striped table-primary">
<thead>
<tr>
<th>Class</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>.table-primary</code></td>
<td>Primary palette colour, to be used on all pages using the primary palette theme.</td>
</tr>
<tr>
<td><code>.table-secondary</code></td>
<td>Secondary palette colour, to be used on all pages using the secondary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-1</code></td>
<td>First tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-2</code></td>
<td>Second tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-3</code></td>
<td>Third tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
</tbody>
</table>
<!-- End pattern: tables //-->
Secondary table heading
Class | Description |
---|---|
.table-primary |
Primary palette colour, to be used on all pages using the primary palette theme. |
.table-secondary |
Secondary palette colour, to be used on all pages using the secondary palette theme. |
.table-tertiary-1 |
First tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-2 |
Second tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-3 |
Third tertiary palette colour, to be used on all pages using the tertiary palette theme. |
Code
Example
<!-- Begin pattern: tables //-->
<table class="table table-striped table-secondary">
<thead>
<tr>
<th>Class</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>.table-primary</code></td>
<td>Primary palette colour, to be used on all pages using the primary palette theme.</td>
</tr>
<tr>
<td><code>.table-secondary</code></td>
<td>Secondary palette colour, to be used on all pages using the secondary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-1</code></td>
<td>First tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-2</code></td>
<td>Second tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-3</code></td>
<td>Third tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
</tbody>
</table>
<!-- End pattern: tables //-->
Tertiary 1 table heading
Class | Description |
---|---|
.table-primary |
Primary palette colour, to be used on all pages using the primary palette theme. |
.table-secondary |
Secondary palette colour, to be used on all pages using the secondary palette theme. |
.table-tertiary-1 |
First tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-2 |
Second tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-3 |
Third tertiary palette colour, to be used on all pages using the tertiary palette theme. |
Code
Example
<!-- Begin pattern: tables //-->
<table class="table table-striped table-tertiary-1">
<thead>
<tr>
<th>Class</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>.table-primary</code></td>
<td>Primary palette colour, to be used on all pages using the primary palette theme.</td>
</tr>
<tr>
<td><code>.table-secondary</code></td>
<td>Secondary palette colour, to be used on all pages using the secondary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-1</code></td>
<td>First tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-2</code></td>
<td>Second tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-3</code></td>
<td>Third tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
</tbody>
</table>
<!-- End pattern: tables //-->
Tertiary 2 table heading
Class | Description |
---|---|
.table-primary |
Primary palette colour, to be used on all pages using the primary palette theme. |
.table-secondary |
Secondary palette colour, to be used on all pages using the secondary palette theme. |
.table-tertiary-1 |
First tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-2 |
Second tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-3 |
Third tertiary palette colour, to be used on all pages using the tertiary palette theme. |
Code
Example
<!-- Begin pattern: tables //-->
<table class="table table-striped table-tertiary-2">
<thead>
<tr>
<th>Class</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>.table-primary</code></td>
<td>Primary palette colour, to be used on all pages using the primary palette theme.</td>
</tr>
<tr>
<td><code>.table-secondary</code></td>
<td>Secondary palette colour, to be used on all pages using the secondary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-1</code></td>
<td>First tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-2</code></td>
<td>Second tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-3</code></td>
<td>Third tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
</tbody>
</table>
<!-- End pattern: tables //-->
Tertiary 3 table heading
Class | Description |
---|---|
.table-primary |
Primary palette colour, to be used on all pages using the primary palette theme. |
.table-secondary |
Secondary palette colour, to be used on all pages using the secondary palette theme. |
.table-tertiary-1 |
First tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-2 |
Second tertiary palette colour, to be used on all pages using the tertiary palette theme. |
.table-tertiary-3 |
Third tertiary palette colour, to be used on all pages using the tertiary palette theme. |
Code
<!-- Begin pattern: tables //-->
<table class="table table-striped table-tertiary-3">
<thead>
<tr>
<th>Class</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>.table-primary</code></td>
<td>Primary palette colour, to be used on all pages using the primary palette theme.</td>
</tr>
<tr>
<td><code>.table-secondary</code></td>
<td>Secondary palette colour, to be used on all pages using the secondary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-1</code></td>
<td>First tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-2</code></td>
<td>Second tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
<tr>
<td><code>.table-tertiary-3</code></td>
<td>Third tertiary palette colour, to be used on all pages using the tertiary palette theme.</td>
</tr>
</tbody>
</table>
<!-- End pattern: tables //-->