In this guide, you'll learn how to configure and create tables.
Become a backer or sponsor to support our work.
You’ll need to upgrade Hugo to v0.134.0
or later, and enable the markup.goldmark.parser.attribute.block
.
hugo.toml
1[markup]
2 [markup.goldmark]
3 [markup.goldmark.parser]
4 [markup.goldmark.parser.attribute]
5 block = true
hugo.yaml
1markup:
2 goldmark:
3 parser:
4 attribute:
5 block: true
hugo.json
1{
2 "markup": {
3 "goldmark": {
4 "parser": {
5 "attribute": {
6 "block": true
7 }
8 }
9 }
10 }
11}
align
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
align | hb.tables | string | - | - | - | - |
Vertical alignment.
Available options: top
, middle
, bottom
.
bordered
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
bordered | hb.tables | boolean | - | true | - | - |
Whether to enable borders globally.
border_style
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
border_style | hb.tables | string | - | - | - | - |
Border style.
Available options: danger
, dark
, light
, info
, primary
, secondary
, success
, warning
.
group_divider
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
group_divider | hb.tables | boolean | - | false | - | - |
Whether to add a thicker border, darker between table groups.
hover
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
hover | hb.tables | boolean | - | true | - | - |
Whether to enable a hover state on tables.
striped
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
striped | hb.tables | boolean | - | true | - | - |
Whether to add zebra-striping on table rows.
striped_columns
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
striped_columns | hb.tables | boolean | - | false | - | - |
Whether to add zebra-striping on table columns.
style
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
style | hb.tables | string | - | - | - | - |
Table style.
Available options: danger
, dark
, light
, info
, primary
, secondary
, success
, warning
.
thead_style
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
thead_style | hb.tables | string | - | - | - | - |
Table header style.
Available options: danger
, dark
, light
, info
, primary
, secondary
, success
, warning
.
hugo.toml
1[params]
2 [params.hb]
3 [params.hb.tables]
4 align = ''
5 border_style = ''
6 bordered = true
7 group_divider = false
8 hover = true
9 striped = true
10 striped_columns = false
11 style = ''
12 thead_style = ''
hugo.yaml
1params:
2 hb:
3 tables:
4 align: ""
5 border_style: ""
6 bordered: true
7 group_divider: false
8 hover: true
9 striped: true
10 striped_columns: false
11 style: ""
12 thead_style: ""
hugo.json
1{
2 "params": {
3 "hb": {
4 "tables": {
5 "align": "",
6 "border_style": "",
7 "bordered": true,
8 "group_divider": false,
9 "hover": true,
10 "striped": true,
11 "striped_columns": false,
12 "style": "",
13 "thead_style": ""
14 }
15 }
16 }
17}
_align
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_align | - | string | - | hb.tables.align | - | - |
Vertical alignment.
Available options: top
, middle
, bottom
.
_borderless
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_borderless | - | boolean | - | false | - | - |
Whether to remove border.
_bordered
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_bordered | - | boolean | - | hb.tables.bordered | - | - |
Whether to enable border.
_border_style
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_border_style | - | string | - | - | - | - |
Border style.
Available options: danger
, dark
, light
, info
, primary
, secondary
, success
, warning
.
_caption
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_caption | - | string | - | - | - | - |
Caption.
_group_divider
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_group_divider | - | boolean | - | hb.tables.group_divider | - | - |
Whether to add a thicker border, darker between table groups.
_hover
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_hover | - | boolean | - | hb.tables.hover | - | - |
Whether to enable a hover state on tables.
_striped
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_striped | - | boolean | - | hb.tables.striped | - | - |
Whether to add zebra-striping on table rows.
_striped_columns
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_striped_columns | - | boolean | - | hb.tables.striped_columns | - | - |
Whether to add zebra-striping on table columns.
_size
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_size | - | string | - | - | - | - |
Table size.
Available options: sm
.
_style
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_style | - | string | - | - | - | - |
Table style.
Available options: danger
, dark
, light
, info
, primary
, secondary
, success
, warning
.
_thead
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_thead | - | boolean | - | true | v0.15.1 | - |
Whether to show the header.
_thead_style
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
_thead_style | - | string | - | - | - | - |
Table header style.
Available options: danger
, dark
, light
, info
, primary
, secondary
, success
, warning
.
The style depends on the default configurations.
1| Default Table |
2| --- |
3| Foo |
4| Bar |
Default Table |
---|
Foo |
Bar |
1| Left | Center | Right |
2| :- | :-: | -: |
3| 1 | 2 | 3 |
4| 1 | 2 | 3 |
5| 1 | 2 | 3 |
Left | Center | Right |
---|---|---|
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1| Heading 1 | Heading 2 |
2| --- | --- |
3| `top` | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
4{_align=top}
Heading 1 | Heading 2 |
---|---|
top | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
1| Heading 1 | Heading 2 |
2| --- | --- |
3| `middle` | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
4{_align=middle}
Heading 1 | Heading 2 |
---|---|
middle | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
1| Heading 1 | Heading 2 |
2| --- | --- |
3| `bottom` | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
4{_align=bottom}
Heading 1 | Heading 2 |
---|---|
bottom | This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells. |
1| Name | Age | Role |
2| --- | :-: | :-: |
3| Foo | 35 | Leader |
4| Bar | 23 | Developer |
5{_caption="Members"}
Name | Age | Role |
---|---|---|
Foo | 35 | Leader |
Bar | 23 | Developer |
1| Primary Table |
2| --- |
3| Foo |
4| Bar |
5{_style=primary}
Primary Table |
---|
Foo |
Bar |
1| Danger Table |
2| --- |
3| Foo |
4| Bar |
5{_style=danger}
Danger Table |
---|
Foo |
Bar |
1| Dark Table |
2| --- |
3| Foo |
4| Bar |
5{_style=dark}
Dark Table |
---|
Foo |
Bar |
1| Primary Bordered Table |
2| --- |
3| Foo |
4| Bar |
5{_border_style=primary}
Primary Bordered Table |
---|
Foo |
Bar |
1| Danger Bordered Table |
2| --- |
3| Foo |
4| Bar |
5{_border_style=danger}
Danger Bordered Table |
---|
Foo |
Bar |
1| Borderless Table |
2| --- |
3| Foo |
4| Bar |
5{_borderless=true}
Borderless Table |
---|
Foo |
Bar |
1| Small Table |
2| --- |
3| Foo |
4| Bar |
5{_size=sm}
Small Table |
---|
Foo |
Bar |
1| Primary Header |
2| --- |
3| Foo |
4| Bar |
5{_thead_style=primary}
Primary Header |
---|
Foo |
Bar |
1| Danger Header |
2| --- |
3| Foo |
4| Bar |
5{_thead_style=danger}
Danger Header |
---|
Foo |
Bar |
1| Dark Header |
2| --- |
3| Foo |
4| Bar |
5{_thead_style=dark}
Dark Header |
---|
Foo |
Bar |
1| | | |
2|-|-|-|
3| 1 | 1 | 1 |
4| 2 | 2 | 2 |
5| 3 | 3 | 3 |
6| 4 | 4 | 4 |
7{_thead=false}
1 | 1 | 1 |
2 | 2 | 2 |
3 | 3 | 3 |
4 | 4 | 4 |