{# Use inline style to set a width on a table header cell #}
{% set header_250px %}
{% set cells %}
{% include '@bolt-components-table/table-cell.twig' with {
content: '250px wide column',
header: true,
attributes: {
style: 'width: 250px;',
},
} only %}
{% include '@bolt-components-table/table-cell.twig' with {
content: '250px wide column',
header: true,
attributes: {
style: 'width: 250px;',
},
} only %}
{% include '@bolt-components-table/table-cell.twig' with {
content: '250px wide column',
header: true,
attributes: {
style: 'width: 250px;',
},
} only %}
{% include '@bolt-components-table/table-cell.twig' with {
content: '250px wide column',
header: true,
attributes: {
style: 'width: 250px;',
},
} only %}
{% endset %}
{% include '@bolt-components-table/table-row.twig' with {
content: cells,
} only %}
{% endset %}
{# Do not set widths for body row cells #}
{% set row %}
{% set cells %}
{% include '@bolt-components-table/table-cell.twig' with {
content: 'This is a regular cell.',
} only %}
{% include '@bolt-components-table/table-cell.twig' with {
content: 'This is a regular cell.',
} only %}
{% include '@bolt-components-table/table-cell.twig' with {
content: 'This is a regular cell.',
} only %}
{% include '@bolt-components-table/table-cell.twig' with {
content: 'This is a regular cell.',
} only %}
{% endset %}
{% include '@bolt-components-table/table-row.twig' with {
content: cells,
} only %}
{% endset %}
{# Change the table component's container to block display to render a full width table #}
{% include '@bolt-components-table/table.twig' with {
header: {
content: header_percent,
},
body: {
content: [
row,
],
},
attributes: {
class: 'u-bolt-block',
},
} only %}