Skip to main content

TableHeaderCell

<ui5-table-header-cell> | Since 2.0.0
info

This web component is available since 2.0 with an experimental flag and its API and behavior are subject to change.

The ui5-table-header-cell component represents a column in the ui5-table.

As it is tightly coupled to the ui5-table, it should only be used in the ui5-table-header-row to ensure correct layout and design.

ES6 Module Import​

import "@ui5/webcomponents/dist/TableHeaderCell.js";

Properties​

width​

DescriptionDefines the width of column.
Typestring
Default"auto"

minWidth​

DescriptionDefines the minimum width of the column.
If the table is in Popin mode, the column will move into the popin when when the minimum width does not fit anymore.
Typestring
Default"auto"

maxWidth​

DescriptionDefines the maximum width of the column.
Typestring
Default"auto"

importance​

DescriptionDefines the importance of the column.
This property affects the popin behaviour. Columns with higher importance will move into the popin area later then less important columns.
Typenumber
Default0

horizontalAlign​

DescriptionDetermines the horizontal alignment of table cells. Note: All values valid for justify-content can be used, not just the ones inside the enumeration.
Type"Left" | "Start" | "Right" | "End" | "Center" | undefined
Defaultundefined

Slots​

default​

DescriptionDefines the content of the component.
TypeArray<Node>

Events​

No events available for this component.

Methods​

No methods available for this component.

CSS Parts​

No CSS parts available for this component.

Column widths​

You are able to set the width of the columns by using the width, minWidth and maxWidth property.

Popin Configuration​

The Popin mode is a responsive design feature tailored to adapt column layouts in UI grids or tables, particularly for smaller screens or constrained container widths.

When screen space becomes limited, Popin mode seamlessly reorganizes columns. Those that cannot fit within the available width are intelligently relocated to the "popin area", an allocated space designed specifically for accommodating additional columns.

You can influence the order of columns appearing the popin area, by defining the importance of each column.

Horizontal cell alignment​

Controls the horizontal alignment of cells by using the horizontalAlign property.

Please note that the behavior of horizontalAlign depends on where you set it:

  • horizontalAlign is set on TableHeaderCell level
    Changes the horizontal alignment of the TableHeaderCell and its corresponding TableCell.
  • horizontalAlign is set on TableCell level only
    The horizontal alignment is only changed for this one TableCell
  • horizontalAlign is set on TableHeaderCell and TableCell level
    Changing the horizontalAlign property on TableHeaderCell level changes only the TableHeaderCell itself and those TableCell without a horizontalAlign property.