{{ aspExample({ code: "<table class=\"asp-table\">
<thead class=\"asp-table__head\">
<tr class=\"asp-table__row asp-table__row–head\">
<th class=\"asp-table__header\" scope=\"col\">Reference</th>
<th class=\"asp-table__header\" scope=\"col\">Submitted</th>
<th class=\"asp-table__header\" scope=\"col\">Assigned to</th>
<th class=\"asp-table__header\" scope=\"col\">Processed</th>
</tr>
</thead>
<tbody class=\"asp-table__body\">
<tr class=\"asp-table__row\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> RAF-RUAYY-LONG-CONTENT</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 09:35</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> John Smith</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
<tr class=\"asp-table__row\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> RAF-RUAYZ-LONG-CONTENT</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 18:37</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> Ashley Kristy</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
</tbody>
</table>", nunjucks: "{{ aspTable({
head: [
{ text: \"Column 1\" },
{ text: \"Column 2\" },
{ text: \"Column 3 numeric: true\",
numeric: true
},
{ text: \"Column 4\" }
],
rows: [
{
cells: [
{ text: \"Row 1, cell 1\" },
{ text: \"Row 1, cell 2\" },
{ number: 1 },
{ text: \"Row 1, cell 4. Extra content to demo width\" }
]
},
{
cells: [
{ text: \"Row 1, cell 1\" },
{ text: \"Row 1, cell 2\" },
{ number: 2 },
{ text: \"Row 1, cell 4. Extra content to demo width\" }
]
}
]
}) }}", title: "", id: "65a92fd59d3c8", url: "" }) }}

When to use this component

Use the table component to let users compare information in rows and columns.

Use tables to present data or information that can be organised in a structured way. This could consist of numbers, text or statistics.

A table should make it easy to:

When not to use this component

Do not use tables for cosmetic reasons or when you can use normal page structure to present the information, for example headers or lists.

Never use the table component to layout content on a page. Instead, use the grid system.

Table with equal columns

{{ aspExample({ code: "<table class=\"asp-table asp-table–equal\">
<thead class=\"asp-table__head\">
<tr class=\"asp-table__row asp-table__row–head\">
<th class=\"asp-table__header\" scope=\"col\">Reference</th>
<th class=\"asp-table__header\" scope=\"col\">Submitted</th>
<th class=\"asp-table__header\" scope=\"col\">Assigned to</th>
<th class=\"asp-table__header\" scope=\"col\">Processed</th>
</tr>
</thead>
<tbody class=\"asp-table__body\">
<tr class=\"asp-table__row\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> RAF-RUAYY</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 09:35</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> John Smith</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
<tr class=\"asp-table__row\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> RAF-RUAYZ</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 18:37</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> Ashley Kristy</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
</tbody>
</table>", nunjucks: "{{ aspTable({
modifier: \"equal\",
head: [
{ text: \"Column 1 equal\" },
{ text: \"Column 2 equal\" },
{ text: \"Column 3 equal\" },
{ text: \"Column 4 equal\" }
],
rows: [
{
href: \"#\",
cells: [
{ text: \"RAF-RUAYY-EXTRA-EXTRA-LONG-CONTENT\" },
{ text: \"John Smith\" },
{ text: \"13 June 2023 09:35\" },
{ number: \"11 June 2023\" }
]
},
{
href: \"#\",
cells: [
{ text: \"RAF–EXTRA-EXTRA-LONG-CONTENT\" },
{ text: \"Ashley Kristy\" },
{ text: \"13 June 2023 18:37\" },
{ number: \"11 June 2023\" }
]
}
]
}) }}", title: "", id: "6659cfaa4c7cd", url: "" }) }}

Table with links

{{ aspExample({ code: "<table class=\"asp-table\">
<thead class=\"asp-table__head\">
<tr class=\"asp-table__row asp-table__row–head\">
<th class=\"asp-table__header\" scope=\"col\">Reference</th>
<th class=\"asp-table__header\" scope=\"col\">Submitted</th>
<th class=\"asp-table__header\" scope=\"col\">Assigned to</th>
<th class=\"asp-table__header\" scope=\"col\">Processed</th>
</tr>
</thead>
<tbody class=\"asp-table__body\">
<tr class=\"asp-table__row asp-table__row–link\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> <a class=\"asp-table__link\" href=\"#\">RAF-RUAYY</a></td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 09:35</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> John Smith</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
<tr class=\"asp-table__row asp-table__row–link\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> <a class=\"asp-table__link\" href=\"#\">RAF-RUAYZ</a></td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 18:37</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> Ashley Kristy</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
</tbody>
</table>", nunjucks: "{{ aspTable({
head: [
{ text: \"Column 1\" },
{ text: \"Column 2\" },
{ text: \"Column 3\" },
{ text: \"Column 4\" }
],
rows: [
{
href: \"#\",
cells: [
{ text: \"Row 1, cell 1, link\" },
{ text: \"Row 1, cell 2\" },
{ text: \"Row 1, cell 3\" },
{ text: \"Row 1, cell 4\" }
]
},
{
href: \"#\",
cells: [
{ text: \"Row 2, cell 1, link\" },
{ text: \"Row 2, cell 2\" },
{ text: \"Row 2, cell 3\" },
{ text: \"Row 2, cell 4\" }
]
}
]
}) }}", title: "", id: "6659cfaa4c83c", url: "" }) }}

Unread Table

{{ aspExample({ code: "<table class=\"asp-table\">
<thead class=\"asp-table__head\">
<tr class=\"asp-table__row asp-table__row–head\">
<th class=\"asp-table__header\" scope=\"col\">Reference</th>
<th class=\"asp-table__header\" scope=\"col\">Submitted</th>
<th class=\"asp-table__header\" scope=\"col\">Assigned to</th>
<th class=\"asp-table__header\" scope=\"col\">Processed</th>
</tr>
</thead>
<tbody class=\"asp-table__body\">
<tr class=\"asp-table__row asp-table__row–unread asp-table__row–link\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> <a class=\"asp-table__link\" href=\"#\">RAF-RUAYY</a></td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 09:35</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> John Smith</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
<tr class=\"asp-table__row asp-table__row–unread asp-table__row–link\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> <a class=\"asp-table__link\" href=\"#\">RAF-RUAYZ</a></td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 18:37</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> Ashley Kristy</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
</tbody>
</table>", nunjucks: "{{ aspTable({
head: [
{ text: \"Column 1\" },
{ text: \"Column 2\" },
{ text: \"Column 3\" },
{ text: \"Column 4\" }
],
rows: [
{
modifier: \"unread\",
href: \"#\",
cells: [
{ text: \"Row 1, cell 1, link\" },
{ text: \"Row 1, cell 2\" },
{ text: \"Row 1, cell 3\" },
{ text: \"Row 1, cell 4\" }
]
},
{
modifier: \"unread\",
href: \"#\",
cells: [
{ text: \"Row 2, cell 1, link\" },
{ text: \"Row 2, cell 2\" },
{ text: \"Row 2, cell 3\" },
{ text: \"Row 2, cell 4\" }
]
}
]
}) }}", title: "", id: "65a92fd59d469", url: "" }) }}

Read Table

{{ aspExample({ code: "{{ aspTable({
head: [
{ text: \"Column 1\" },
{ text: \"Column 2\" },
{ text: \"Column 3\" },
{ text: \"Column 4\" }
],
rows: [
{
modifier: \"read\",
href: \"#\",
cells: [
{ text: \"Row 1, cell 1, link\" },
{ text: \"Row 1, cell 2\" },
{ text: \"Row 1, cell 3\" },
{ text: \"Row 1, cell 4\" }
]
},
{
modifier: \"read\",
href: \"#\",
cells: [
{ text: \"Row 2, cell 1, link\" },
{ text: \"Row 2, cell 2\" },
{ text: \"Row 2, cell 3\" },
{ text: \"Row 2, cell 4\" }
]
}
]
}) }}", nunjucks: "", title: "", id: "65a92fd59d4d3", url: "" }) }}

Processed Table

{{ aspExample({ code: "<table class=\"asp-table\">
<thead class=\"asp-table__head\">
<tr class=\"asp-table__row asp-table__row–head\">
<th class=\"asp-table__header\" scope=\"col\">Reference</th>
<th class=\"asp-table__header\" scope=\"col\">Submitted</th>
<th class=\"asp-table__header\" scope=\"col\">Assigned to</th>
<th class=\"asp-table__header\" scope=\"col\">Processed</th>
</tr>
</thead>
<tbody class=\"asp-table__body\">
<tr class=\"asp-table__row asp-table__row–processed asp-table__row–link\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> <a class=\"asp-table__link\" href=\"#\">RAF-RUAYY</a></td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 09:35</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> John Smith</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
<tr class=\"asp-table__row asp-table__row–processed asp-table__row–link\">
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Reference</span> <a class=\"asp-table__link\" href=\"#\">RAF-RUAYZ</a></td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Submitted</span> 13 June 2023 18:37</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Assigned to</span> Ashley Kristy</td>
<td class=\"asp-table__cell\"><span class=\"asp-table__responsive-heading\" aria-hidden=\"true\">Processed</span> 11 June 2023</td>
</tr>
</tbody>
</table>", nunjucks: "{{ aspTable({
head: [
{ text: \"Column 1\" },
{ text: \"Column 2\" },
{ text: \"Column 3\" },
{ text: \"Column 4\" }
],
rows: [
{
modifier: \"processed\",
href: \"#\",
cells: [
{ text: \"Row 1, cell 1, link\" },
{ text: \"Row 1, cell 2\" },
{ text: \"Row 1, cell 3\" },
{ text: \"Row 1, cell 4\" }
]
},
{
modifier: \"processed\",
href: \"#\",
cells: [
{ text: \"Row 2, cell 1, link\" },
{ text: \"Row 2, cell 2\" },
{ text: \"Row 2, cell 3\" },
{ text: \"Row 2, cell 4\" }
]
}
]
}) }}", title: "", id: "65a92fd59d57e", url: "" }) }}

Status of development

The below criteria all need to be met for a component to be considered as fully developed for use within the ASP Digital Design System.


{{ aspTable({
head: [
{ text: 'Development criteria'},
{ text: 'Status'}
],
rows: [
{
cells: [
{ text: 'WCAG 2.2 compliant'},
{ html: '<span class="status">Not started</span>'}
]
},
{
cells: [
{ text: 'WCAG 2.1 compliant'},
{ html: '<span class="status status–red">Failing</span>'}
]
},
{
cells: [
{ text: 'HTML / Nunjucks version'},
{ html: '<span class="status status–green">Complete</span>'}
]
},
{
cells: [
{ text: 'Figma version'},
{ html: '<span class="status status">Not started</span>'}
]
},
{
cells: [
{ text: 'M365 versions'},
{ html: '<span class="status status">Not started</span>'}
]
},
{
cells: [
{ text: 'Documentation'},
{ html: '<span class="status status–yellow">In progress</span>'}
]
}
]
}) }}