0

Followed steps in the post: Can Office Fabric DetailsList column headers be styled?. I was able to style the header, but few of headers are very lengthy and its getting truncated.

I tried using wordWrap: 'break-word' in style but it didn't change anything:

private renderCustomHeaderTooltip(tooltipHostProps: ITooltipHostProps): JSX.Element {
    return (
      <span
        style={{
          display: 'flex',
          fontWeight: 'bold',
          wordWrap: 'break-word'
        }}
      >
        {tooltipHostProps.children}
      </span>
    );
  }

Is it possible to wrap and display full header in Office-UI-fabric Detail list?

1 Answers1

1

Column width could be adjusted by specifying IColumn.minWidth and IColumn.maxWidth properties, for example:

const columns = 
[
    {
      key: "thumbnail",
      name: "too long column name goes here... too long column name goes here... too long column name goes here... too long column name goes here... too long column name goes here...",
      fieldName: "thumbnail",
      minWidth: 1220,
      maxWidth: 1440,
    },
    ...
];

<DetailsList
    items={items}
    setKey="set"
    columns={columns}
    onRenderDetailsHeader={this.renderDetailsHeader}
  />

Result

enter image description here

Vadim Gremyachev
  • 57,952
  • 20
  • 129
  • 193