Search code examples
office-ui-fabricoffice-ui-fabric-reactfluent-ui

How to customize the column title style in Details list


How can I change the font size and padding of the title cell in details list. I am using onRenderDetailsHeader prop to customize header render.

private renderDetailsHeader = (detailsHeaderProps: IDetailsHeaderProps) => {
    return (
      <DetailsHeader
        {...detailsHeaderProps}
        onRenderColumnHeaderTooltip={this.renderCustomHeaderTooltip}
      />
    );
  }

private renderCustomHeaderTooltip = (tooltipHostProps: ITooltipHostProps) => {
  return (
    <span
      style={{
        display: "flex",
        fontFamily: "Tahoma",
        fontSize: "10px",
        justifyContent: "left",
        paddingLeft: '0 px'
      }}
    >
      {tooltipHostProps.children}
   </span>
  );
}

Codepen


Solution

  • In IDetailsHeaderProps['columns'] or simply IColumn[] => IColumn has 'headerClassName' key where you can specify the necessary styles to each of the column.