` | Initiates a table header sort cell button content container. **Required for sortable table columns** Note: this is only necessary because `
` does not support`display: grid`. |
| `.pf-v6-c-table__sort-indicator` | `.pf-v6-c-table__sort > .pf-v6-c-table__button > span` | Initiates a sort indicator. **Required for sortable table columns** |
| `.pf-m-selected` | `.pf-v6-c-table__sort` | Modifies for sort selected state. **Required for sortable table columns** |
| `.pf-m-help` | `.pf-v6-c-table__sort`, `.pf-v6-c-table th` | Modifies a sortable table header to accommodate a help tooltip. **Required for sortable table columns with help tooltips** |
| `.fa-arrows-alt-v` | `.pf-v6-c-table__sort > .pf-v6-c-table__button > .pf-v6-c-table__sort-indicator > .fas` | Initiates icon within unsorted, sortable table header. **Required for sortable table columns** |
| `.fa-long-arrow-alt-up` | `.pf-v6-c-table__sort > .pf-v6-c-table__button > .pf-v6-c-table__sort-indicator > .fas` | Initiates icon within ascending sorted and selected, sortable table header. **Required for sortable table columns** |
| `.fa-long-arrow-alt-down` | `.pf-v6-c-table__sort > .pf-v6-c-table__button > .pf-v6-c-table__sort-indicator > .fas` | Initiates icon within descending sorted and selected, sortable table header. **Required for sortable table columns** |
### Overflow menu usage, desktop
```html
Repositories
Branches
Pull requests
Actions
Repository 1
10
25
Repository 2
10
25
```
### Overflow menu usage, overflow menu collapsed
```html
```
### Overflow menu usage, mobile
```html
```
## With checkboxes, radio select, and actions
### Checkboxes and actions example
```html
```
### Single select radio example
```html
```
When including interactive elements in a table, the primary, descriptive cell in the corresponding row is a ``, rather than a ` `. In this example, 'Node 1' and 'Node 2 siemur/test-space' are ` `s.
When header cells are empty or they contain interactive elements, ` ` should be replaced with ` `.
### Checkboxes, radio select, and actions accessibility
| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `aria-labelledby="[row_header_id]"` or `aria-label="[descriptive text]` | `.pf-v6-c-table__check input` | Provides an accessible name for the checkbox or radio input. **Required** |
| `id` | row header ` > *` | Provides an accessible description for the checkbox or radio. **Required if using `aria-labelledby` for `.pf-v6-c-table__check input`** |
### Checkboxes, radio select, and actions usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-table__check` | ` `, ` ` | Initiates a checkbox or radio input table cell. |
| `.pf-v6-c-table__action` | ` `, ` ` | Initiates an action table cell. |
| `.pf-v6-c-table__inline-edit-action` | ` `, ` ` | Initiates an inline edit action table cell. |
## Expandable
Note: Table column widths will respond automatically when toggling expanded rows. To retain column widths between expanded and collapsed states, column header and/or data cell widths must be set.
### Expandable example
```html
Repositories
Branches
Pull requests
Links
Actions
Node 1
siemur/test-space
10
25
Link 1
Actions
Actions
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Actions
Node 2
siemur/test-space
10
25
Link 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 3
siemur/test-space
10
25
Link 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 4
siemur/test-space
10
25
Link 4
Expandable row content has no padding.
```
### Expandable with set width columns example
```html
Repositories
Branches
Pull requests
Links
Actions
Node 1
siemur/test-space
10
25
Link 1
Actions
Actions
Span four lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Actions
Node 2
siemur/test-space
10
25
Link 2
Actions
Actions
Span three and four
Span five and six
Actions
Node 3
siemur/test-space
10
25
Link 3
Span all Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 4
siemur/test-space
10
25
Link 4
Span one, two, and three
Span four and five
Span six and seven
```
### Expandable with nested table example
```html
```
Note: To apply padding to `.pf-v6-c-table__expandable-row`, wrap the content in `.pf-v6-c-table__expandable-row-content`. For no padding add `.pf-m-no-padding` to `.pf-v6-c-table__expandable-row` > ` `
### Expandable accessibility
| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `hidden` | `.pf-v6-c-table__expandable-row` | Indicates that the expandable content is hidden. **Required** |
| `aria-expanded="true"` | `.pf-v6-c-table__toggle` > `.pf-v6-c-button` | Indicates that the row is visible. **Required**|
| `aria-label="[descriptive text]"` | `.pf-v6-c-table__toggle` > `.pf-v6-c-button` | Provides an accessible name for toggle button. **Required**|
| `aria-labelledby="[title_cell_id] [button_id]"` | `.pf-v6-c-table__toggle` > `.pf-v6-c-button` | Provides an accessible description for toggle button. **Required** |
| `id="[button_id]"` | `.pf-v6-c-table__toggle` > `.pf-v6-c-button` | Provides a reference for toggle button description. **Required** |
| `aria-controls="[id of element the button controls]"` | `.pf-v6-c-table__toggle` > `.pf-v6-c-button` | Identifies the expanded content controlled by the toggle button. **Required** |
### Expandable usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-table__toggle-icon` | `` | Initiates the table toggle icon wrapper. |
| `.pf-v6-c-table__expandable-row` | `` | Initiates an expandable row. |
| `.pf-v6-c-table__expandable-row-content` | `.pf-v6-c-table__expandable-row` > `` > `` | Initiates an expandable row content wrapper. |
| `.pf-m-expanded` | `.pf-v6-c-table__toggle` > `.pf-v6-c-button`, `.pf-v6-c-table__expandable-row` | Modifies for expanded state. |
| `.pf-m-no-padding` | `.pf-v6-c-table__expandable-row` > `
` | Modifies the expandable row to have no padding. |
## Compound expansion
### Compound expansion example
```html
Repositories
Branches
Pull requests
Workspaces
Last commit
Links
Actions
10
234
4
siemur/test-space
20 minutes
Open in Github
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
2
82
1
siemur/test-space
1 day ago
Open in Github
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
4
4
1
siemur/test-space
2 days ago
Open in Github
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
```
### Compound expansion accessibility
| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `hidden` | `.pf-v6-c-table__expandable-row` | Indicates that the expandable content is hidden. **Required** |
| `aria-expanded="true"` | `.pf-v6-c-table__compound-expansion-toggle` > `.pf-v6-c-button` | Indicates that the row is visible. **Required**|
| `aria-controls="[id of element the button controls]"` | `.pf-v6-c-table__compound-expansion-toggle` > `.pf-v6-c-button` | Identifies the expanded content controlled by the toggle button. **Required** |
### Compound expansion usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-table__control-row` | `.pf-v6-c-table__expandable > ` | Modifies a compound expandable table control row. |
| `.pf-m-expanded` | ` `, `.pf-v6-c-table__compound-expansion-toggle` > `.pf-v6-c-button` | Modifies a tbody with a row and an expandable row. |
| `.pf-v6-c-table__compound-expansion-toggle` | `` | Modifies a ` ` on active/focus. |
## Compact variant
### Compact example
```html
```
### Compact expandable example
```html
Repositories
Branches
Pull requests
Links
Actions
Node 1
10
25
Link
Actions
Actions
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Actions
Node 2
10
25
Link
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 3
10
25
Link
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 4
10
25
Link
This content has no padding.
Node 5
10
25
Link
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 6
10
25
Link
Actions
Actions
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Actions
Node 7
10
25
Link
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 8
10
25
Link
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 9
10
25
Link
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
```
### Compact Usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-compact` | `.pf-v6-c-table` | Modifies for a compact table. |
## Clickable
### Clickable example
```html
```
### Clickable and expandable example
```html
```
### Clickable accessibility
| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `tabindex="0"` | `.pf-v6-c-table tbody.pf-m-clickable` | Inserts the clickable table element into the tab order of the page so that it is focusable. **Required** |
### Clickable and selected usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-clickable` | `.pf-v6-c-table tbody`, `.pf-v6-c-table tr` | Modifies a tbody or tr table element to be clickable. |
| `.pf-m-selected` | `.pf-v6-c-table tbody`, `.pf-v6-c-table tr` | Modifies a selectable tbody or tr table element to be selected. |
## Tree table
### Tree table basic
```html
Count
Size
Data Stores
Actions
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
```
### Tree table with checkboxes
```html
Count
Size
Data Stores
Actions
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
```
### Tree table with checkboxes and icons
```html
Count
Size
Data Stores
Actions
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
```
### Tree with no children or indentation
```html
Count
Size
Data Stores
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
10
25
5
```
### Tree table accessibility
| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `role="treegrid"` | `.pf-v6-c-table.pf-m-tree-view` | Identifies the `table` as a treegrid. **Place on the outermost `table` only** |
| `role="row"` | `.pf-v6-c-table.pf-m-tree-view tr` | Identifies the `tr` element as a `row`. The row role is not an implicit semantic for the tr element when in a treegrid. |
| `role="gridcell"` | `.pf-v6-c-table.pf-m-tree-view tr` | Identifies the `td` as a gridcell. The `gridcell` role is not an implicit semantic for the td element when in a treegrid. |
| `tabindex="-1"` | `.pf-v6-c-table.pf-m-tree-view tr` | Makes the element with the treeitem role focusable without including it in the tab sequence of the page. |
| `tabindex="0"` | `.pf-v6-c-table.pf-m-tree-view tr` | Includes the element with the treeitem role in the tab sequence. Only one treeitem in the tree has tabindex="0". When the user moves focus in the tree, the element included in the tab sequence changes to the element with focus. |
| `aria-expanded="false"` | `.pf-v6-c-table.pf-m-tree-view tr` | For an expandable item, indicates the parent node is closed, i.e., the descendant elements are not visible. |
| `aria-expanded="true"` | `.pf-v6-c-table.pf-m-tree-view tr.pf-m-expanded` | Indicates the parent node is open, i.e., the descendant elements are visible. |
| `aria-level="number"` | `.pf-v6-c-table.pf-m-tree-view tr` | Defines the level of the row in the hierarchical treegrid structure. Counting is one-based. Root rows have aria-level=“1”. |
| `aria-setsize="number"` | `.pf-v6-c-table.pf-m-tree-view tr` | Defines the number of rows in the set of rows that are in the same branch and at the same level within the hierarchy. |
| `aria-posinset="number"` | `.pf-v6-c-table.pf-m-tree-view tr` | Defines the position of the row within the set of other rows that are in the same branch and at the same level within the hierarchy. Counting is one-based, not zero-based. |
### Tree table usage
| Class | Applied | Outcome |
| -- | -- | -- |
| `.pf-v6-c-table__tree-view-main` | `` | Initiates a tree view table main container. **Required with tree view** |
| `.pf-v6-c-table__tree-view-text` | `
` | Initiates a tree view table text element. **Required with tree view** |
| `.pf-v6-c-table__tree-view-icon` | `
` | Initiates a tree view icon wrapper. **Required with tree view** |
| `.pf-v6-c-table__tree-view-title-header-cell` | ` ` | Initiates a tree view title header cell. **Required with tree view** |
| `.pf-v6-c-table__tree-view-details-toggle` | `` | Initiates a tree view details toggle container. |
| `.pf-v6-c-table__tree-view-details-toggle-icon` | `` | Initiates a tree view details toggle icon. |
| `.pf-m-treeview-details-expanded` | `` | Modifies a tbody with a row and an expandable row. |
| `.pf-m-no-inset` | `.pf-v6-c-table.pf-m-tree-view` , `.pf-v6-c-table.pf-m-tree-view ` | Modifies a tree view `.pf-v6-c-table__tree-view-main` indentation. |
## Borderless variant
### Borderless example
```html
```
### Borderless compact example
```html
```
### Borderless expandable example
```html
Expand rows
Repositories
Branches
Pull requests
Links
Actions
Node 1
siemur/test-space
10
25
Link 1
Actions
Actions
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Actions
Node 2
siemur/test-space
10
25
Link 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 3
siemur/test-space
10
25
Link 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 4
siemur/test-space
10
25
Link 4
Expandable row content has no padding.
```
### Borderless with compound expansion example
```html
Repositories
Branches
Pull requests
Workspaces
Last commit
Links
Actions
10
234
4
siemur/test-space
20 minutes
Open in Github
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
10
234
4
siemur/test-space
20 minutes
Open in Github
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
2
82
1
siemur/test-space
1 day ago
Open in Github
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
4
4
1
siemur/test-space
2 days ago
Open in Github
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
Description
Date
Status
Actions
Item one
May 9, 2018
Active
Item two
May 9, 2018
Warning
Item three
May 9, 2018
Active
Item four
May 9, 2018
Active
Item five
May 9, 2018
Active
```
### Borderless usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-no-border-rows` | `.pf-v6-c-table.pf-m-compact` | Modifies to remove borders between rows. **Note: Does not affect `.pf-v6-c-table__control-row`.** |
| `.pf-m-expandable` | `.pf-v6-c-table.pf-m-compact` | Indicates that the table has expandable rows. |
## Width modifiers
### Width modifiers examples
```html
```
### Width modifiers usage
Width modifiers control the width of the columns. To control the responsive behavior of the table at different screen widths, see [responsive table behavior](#responsive-table-behavior).
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-width-[10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, or 90]` | ``, ` ` | Percentage based modifier for `th` and `td` widths. **Recommended for sortable title cell** |
| `.pf-m-width-max` | ` `, ` ` | Percentage based modifier for `th` and `td` maximum width. |
| `.pf-m-fit-content` | ` `, ` ` | Percentage based modifier for `th` and `td` minimum width with no text wrapping. |
## Hidden/visible breakpoint modifiers
### Hidden/visible breakpoint modifiers example
```html
Repositories
Branches
Pull requests
Workspaces
Last commit
Visible only on md breakpoint
10
Hidden only on md breakpoint
5
Hidden on xs breakpoint
Repository 2
10
25
5
2 days ago
Repository 3
10
25
5
2 days ago
Repository 4
10
25
5
2 days ago
```
### Hidden/visible breakpoint modifiers usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-hidden{-on-[breakpoint]}` | `.pf-v6-c-table tr > th`, `.pf-v6-c-table tr > td` | Hides a table cell at optional [breakpoint](/developer-resources/global-css-variables#breakpoint-variables-and-class-suffixes), or hides it at all breakpoints with `.pf-m-hidden`. **Note: Needs to apply to all cells in the column you want to hide.** |
| `.pf-m-visible{-on-[breakpoint]}` | `.pf-v6-c-table tr > th`, `.pf-v6-c-table tr > td` | Shows a table cell at optional [breakpoint](/developer-resources/global-css-variables#breakpoint-variables-and-class-suffixes). |
## Text control modifiers
To better control table cell behavior, PatternFly provides a series of modifiers to help contextually control layout. By default, `thead` cells are set to truncate, whereas `tbody` cells are set to wrap. Both `th` and `td` cells use a set of shared css properties mapped to customizable css variable values. Because only the shared css variables are changed by the modifier selector and not the properties, the modifier can be applied to any parent element up until `.pf-v6-c-table` itself \[`thead`, `tbody`, `tr`, `th`, `td`, `.pf-v6-c-table__text`].
### Text control example
```html
Truncate (width 20%)
Break word
Wrapping table header text. This
th
text will wrap instead of truncate.
Fit content
Wrapping
This text will truncate instead of wrap in table layout and wrap gracefully in grid layout.
http://thisisaverylongurlthatneedstobreakusethebreakwordmodifier.org
By default,
thead
cells will truncate and
tbody
cells will wrap. Use
.pf-m-wrap
on a
th
to change its behavior.
This cell's content will adjust itself to the parent th width. This modifier only affects table layouts.
No wrap
```
By default, truncation and wrapping settings do not affect the grid layout, but text will fallback gracefully by passively wrapping long strings. Truncation and wrapping settings will persist with the addition of a `.pf-v6-c-table__text` wrapper on table cell content. In addition to `.pf-v6-c-table__text`, all PatternFly layouts can be used in table cells and contain table text elements.
### Text control using the table text element example
```html
This table contains
.pf-v6-c-table__text
examples. The
.pf-v6-c-table__text
element can be using alone or in a nested configuration.
Selector/element
Result
th.pf-m-truncate
This table cell contains a single
`.pf-v6-c-table__text`
wrapper with the parent table cell applying
`.pf-m-truncate`
. The child
`.pf-v6-c-table__text`
element will inherit the modifier settings and apply to the grid layout.
.pf-v6-l-stack
Because
.pf-m-grid
applies a grid layout to
.pf-v6-c-table
, child elements will stack in the grid layout. To prevent this, wrap multiple elements with a div or use a PatternFly layout.
The
.pf-v6-c-table__text
element
can additionally be nested, like in this example. The next
.pf-v6-c-table__text
element has a very long url whose width needs be constrained.
This
.pf-v6-c-table__text
element
applies its own built in grid layout
.pf-m-stack
as well as a gutter
.pf-m-gutter
.
.pf-v6-l-flex
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
.pf-v6-l-flex
This is paragraph that we want to wrap. It doesn' t need a modifier and has no extra long strings. Any modifier available for the flex layout can be used here.
.pf-v6-l-grid
Item 1
Item 2
Item 3
Item 4
This is paragraph that we want to wrap. It doesn' t need a modifier and has no extra long strings. Any modifier available for the flex layout can be used here.
```
### Table with long strings in the content
Long strings in table cells will push that column wider and possible take from other columns. This can cause content or headers to be truncated.
```html
Repositories
Branches
Pull requests
Workspaces
Last commit
Long lines of text will shrink adjacent column widths.
10
25
5
2 days ago
This example is not responsive. Adjacent
tbody
cells will shrink as a result of this text being a longer string and adjacent text being shorter in length. Truncation can be overridden in
th
cells with the addition of
.pf-m-wrap
,
.pf-m-nowrap
or
.pf-m-fit-content
.
10
25
5
2 days ago
```
### Width constrained
Add a [width modifier](#width-modifiers) to `thead th` to limit string length or add `.pf-m-truncate` to `tbody td`.
```html
Width 40
Branches
Pull requests
Fit content th
Last commit
Since this is a long string of text and the other cells contain short strings (narrower than their table header), we'll need to control width this table header's width. Let's set width to 40%.
10
25
5
2 days ago
This string will truncate in table mode only. Since this is a long string of text and the other cells contain short strings (narrower than their table header), we'll need to control width this table header's width. Let's set width to 40%.
10
25
5
2 days ago
```
### Text control modifiers usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-table__text` | `th > *`, `td > *` | Initiates a table text element. |
| `.pf-m-wrap` | `thead`, `tbody`, `tr`, `th`, `td`, `.pf-v6-c-table__text` | Sets table cell content to wrap. If applied to `thead`, `tbody` or `tr`, then all child cells will be affected. This is the default behavior for tbody
cells. |
| `.pf-m-truncate` | `thead`, `tbody`, `tr`, `th`, `td`, `.pf-v6-c-table__text` | Sets text to truncate based on a minimum width and available space adjacent table cells. If applied to `thead`, `tbody` or `tr`, then all child cells will be affected. This is the default behavior for thead
cells. |
| `.pf-m-nowrap` | `thead`, `tbody`, `tr`, `th`, `td`, `.pf-v6-c-table__text` | Unsets min/max width and sets whitespace to nowrap. If applied to `thead`, `tbody` or `tr`, then all child cells will be affected. This is specifically beneficial for cell's whose thead th
cells are blank. The following example highlights link text that should display inline. Be careful with this modifier, it will prioritize its cell's content above all other cell's contents. |
| `.pf-m-fit-content` | `thead`, `tbody`, `tr`, `th`, `td`, `.pf-v6-c-table__text` | Fit column width to cell content. If applied to `thead`, `tbody` or `tr`, then all child cells will be affected. |
| `.pf-m-break-word` | `thead`, `tbody`, `tr`, `th`, `td`, `.pf-v6-c-table__text` | Breaks long strings to break wherever necessary as defined by the table layout. If applied to `thead`, `tbody` or `tr`, then all child cells will be affected. |
## Sticky table modifiers
**Note:** Sticky table headers and columns have a higher `z-index` than the `z-index` used for menus (dropdown, select, etc). The intent is that the contents of a scrollable table will scroll under the sticky header/column, including any expanded menus. However, there may be use cases where a menu needs to appear on top of a sticky header/column, such as an expanded menu in a toolbar above a table with a sticky header.
There are a few ways this can be handled:
* Manipulate the `z-index` of the menu and/or table headers/columns manually.
* Use the `menuAppendTo` prop in non-composable react components with menus to append the menu to an element outside of the table (e.g., the `` element) so that the menu has a higher stacking context than - and can appear on top of - sticky headers/columns as well as appear outside of any scrollable content in the table.
* In the case where the menu is outside of the table (e.g., above the table in a toolbar, or below the table and the menu expands up), assign the entire table a lower `z-index` than the `z-index` of the menu. This creates a lower stacking context for the entire table compared to the menu, while preserving the stacking context of the elements inside of the table.
### Sticky header
```html
```
### Sticky column
```html
```
### Multiple sticky columns
```html
```
### Sticky columns and header
```html
```
### Sticky right column
```html
```
### Sticky table usage
For sticky columns to function correctly, the parent table's width must be controlled with `.pf-v6-c-scroll-inner-wrapper`. For sticky columns and sticky headers to function correctly, the parent table needs an inner and outer wrapper (`.pf-v6-c-scroll-outer-wrapper` and `.pf-v6-c-scroll-inner-wrapper`)
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-sticky-header` | `.pf-v6-c-table` | Makes the table cells in `` sticky to the top of the table on scroll. |
| `.pf-v6-c-scroll-outer-wrapper` | `` | Initiates a table container sticky columns outer wrapper. |
| `.pf-v6-c-scroll-inner-wrapper` | `
` | Initiates a table container sticky columns inner wrapper. |
| `.pf-v6-c-table__sticky-cell` | `
`, ` ` | Initiates a sticky table cell. |
| `.pf-m-right`, `.pf-m-inline-end` | `.pf-v6-c-table__sticky-cell` | Initiates a sticky, right-hand (in LTR) or left-hand (in RTL) table cell. |
| `.pf-m-left`, `.pf-m-inline-start` | `.pf-v6-c-table__sticky-cell` | Initiates a sticky, left-hand (in LTR) or right-hand (in RTL) table cell. |
## Nested column headers
### Nested column headers and expandable rows
```html
```
### Nested column headers example
```html
```
### Nested column headers, sticky header
```html
```
### Nested column header modifier usage
## Favorites
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-nested-column-header` | `` | Modifies a table header to handle nested header cells. |
| `.pf-m-border-right` | ``, ` ` | Modifies a table cell to show a right border. |
| `.pf-m-border-left` | ` `, ` ` | Modifies a table cell to show a left border. |
### Favorites examples
```html
```
### Favorites sortable example
```html
Repositories
Branches
Pull requests
Workspaces
Last commit
Repository 1 . This is a long title that will wrap to multiple lines. This is a long title that will wrap to multiple lines. This is a long title that will wrap to multiple lines. This is a long title that will wrap to multiple lines.
10
25
5
2 days ago
Repository 3
10
25
5
2 days ago
Repository 2
10
25
5
2 days ago
Repository 4
10
25
5
2 days ago
Repository 5
10
25
5
2 days ago
```
### Favorites accessibility
| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `role="grid"` | `.pf-v6-c-table` | Identifies the element that serves as the grid widget container. **Required** |
| `aria-label` | `.pf-v6-c-table` | Provides an accessible name for the table when a descriptive `` or `` is not available. **Required in the absence of `` or ``** |
| `data-label="[td description]"` | `` | This attribute replaces table header in mobile viewport. It is rendered by `::before` pseudo element. |
### Favorites usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-table__favorite` | `td` | Initiates a favorite table body cell. |
| `.pf-m-favorited` | `.pf-v6-c-table__favorite` | Modifies a favorite cell for the favorited state. |
| `.pf-m-favorite` | `.pf-v6-c-table__sort` | Modifies a sortable table header cell for use with a favorites column. |
## Draggable rows
### Draggable rows example isBeta
```html
Activate the reorder button and use the arrow keys to reorder the list or use your mouse to drag/reorder. Press escape to cancel the reordering.
This is the table caption
Drag row
Repositories
Branches
Pull requests
Workspaces
Last commit
Draggable icon disabled
10
25
5
2 days ago
Table cell
10
25
5
2 days ago
Ghost row
10
25
5
2 days ago
Table cell
10
25
5
2 days ago
This is the aria-live section that provides real-time feedback to the user.
```
### Draggable rows accessibility
| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `aria-pressed="true or false"` | `.pf-v6-c-table__draggable .pf-v6-c-button` | Indicates whether the button is currently pressed or not. |
| `aria-live` | `[element with live text]` | To give screen reader users live feedback about what's happening during interaction with the table, both during drag and drop interactions and keyboard interactions. **Highly Recommended** |
| `aria-describedby="[id value of applicable content]"` | `.pf-v6-c-table__draggable .pf-v6-c-button` | Gives the draggable button an accessible description by referring to the textual content that describes how to use the button to drag elements. The example here uses a `
`. **Highly recommended** |
| `aria-labelledby="[id of .pf-v6-c-table__draggable .pf-v6-c-button] [id of row title text]"` | `.pf-v6-c-table__draggable .pf-v6-c-button` | Provides an accessible name for the draggable button. |
| `id="[]"` | `.pf-v6-c-table__draggable .pf-v6-c-button`, `[element with row title text]` | Gives the button and the text element accessible IDs. |
### Draggable rows usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-table__draggable` | ` ` | Initiates a draggable table cell. |
| `.pf-m-drag-over` | `.pf-v6-c-table` | Modifies the table to indicate that a draggable item is being dragged over the table. |
## Striped
Basic striped table rows are supported on tables with a single ` ` element and expandable tables by applying `.pf-m-striped` to the `.pf-v6-c-table` element, which applies striped styling to odd table rows. For more complex tables, `.pf-m-striped` can be applied directly to the ` ` and `` elements. The class `.pf-m-striped-even` can be applied to ` ` elements to apply striped styling to the even rows in the table body. This is for use in tables with multiple ` ` elements where even row striping may be needed to ensure visual consistency.
### Striped table example
```html
This is the table caption
Repositories
Branches
Pull requests
Workspaces
Last commit
Repository 1
10
25
5
2 days ago
Repository 2
10
25
5
2 days ago
Repository 3
10
25
5
2 days ago
Repository 4
10
25
5
2 days ago
```
### Striped expandable table example
```html
Expand row
Repositories
Branches
Pull requests
Links
Actions
Node 1
siemur/test-space
10
25
Link 1
Actions
Actions
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Actions
Node 2
siemur/test-space
10
25
Link 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 3
siemur/test-space
10
25
Link 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Node 4
siemur/test-space
10
25
Link 4
Expandable row content has no padding.
```
### Striped multiple tbody example
```html
This is the table caption
Repositories
Branches
Pull requests
Workspaces
Last commit
tbody 1 - Repository 1
(odd rows striped)
10
25
5
2 days ago
tbody 1 - Repository 2
10
25
5
2 days ago
tbody 1 - Repository 3
(odd rows striped)
10
25
5
2 days ago
tbody 2 - Repository 4
10
25
5
2 days ago
tbody 2 - Repository 5
(even rows striped using `.pf-m-striped-even`)
10
25
5
2 days ago
tbody 2 - Repository 6
10
25
5
2 days ago
tbody 2 - Repository 7
(even rows striped using `.pf-m-striped-even`)
10
25
5
2 days ago
```
### Striped tr example
```html
This is the table caption
Repositories
Branches
Pull requests
Workspaces
Last commit
Repository 1
10
25
5
2 days ago
Repository 2
10
25
5
2 days ago
Repository 3
10
25
5
2 days ago
Repository 4
10
25
5
2 days ago
```
### Striped table usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-m-striped` | `.pf-v6-c-table`, `tbody`, `tr` | Modifies odd table rows to be striped. |
| `.pf-m-striped-even` | `tbody` | Modifies even table rows to be striped. For use in tables with multiple `tbody` elements where adjacent `tbody` elements need even row striping to maintain visual consistency. |
## Documentation
### Overview
Because the table component is not used for layout and presents tabular data only, it requires the use of `role="grid"`. Expandable table content (`.pf-v6-c-table__expandable-content`) is placed within a singular `` per expandable row, that can span multiple columns.
### Role="grid"
Applying `role="grid"` to tables enhances accessible interaction while in table layout, however the responsive, css grid based layout can cause unexpected interactions. Therefore, for css grid layout, it is recommended that `role="grid"` be removed.
### Sortable tables
Table columns may shift when expanding/collapsing. To address this, set `.pf-m-fit-content`, or assign a width `.pf-m-width-[width]` to the corresponding ` ` defining the column or ` ` within the column. Width values are `[10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90]` or `max`.
### Table header cells
By default, all table header cells are set to `white-space: nowrap`. If a ` `'s content needs to wrap, apply `.pf-m-wrap`.
### Implementation support
* One expandable toggle button, positioned in the first cell of a non-expandable row, preceding an expandable row.
* One checkbox or radio input, positioned in the first or second cell of a non-expandable row.
* One action button, positioned in the last cell of a non-expandable row.
* Tabular data.
* Compact presentation modifier (not compatible with expandable table).