diff --git a/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx b/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx index 32075a3e04..b95b4a354a 100644 --- a/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +++ b/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx @@ -52,18 +52,17 @@ export const TableHeaderCell = ({ const isLeafColumn = header?.column.getLeafColumns().length === 1 && header?.column.getLeafColumns()[0].id === header.column.id + + const isLastHeaderCell = + header?.column.parent?.columns.at(-1) === header?.column || + (header?.colSpan > 1 && header?.column.parent !== undefined); const cellClassName = classnames( "table-header-cells", `${isChrome() ? "chrome-styles" : ""}`, `${enableSorting ? "table-header-cells-active" : ""}`, { "pinned-left": responsive === "scroll" && isPinnedLeft }, - `${ - header?.column.parent?.columns.at(-1) === header?.column || - (header?.colSpan > 1 && header?.column.parent !== undefined) - ? "last-header-cell" - : "" - }` + isLastHeaderCell ? "last-header-cell" : "" ); const cellId = `${loading ? diff --git a/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx b/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx index 49f6443e22..5c416ea495 100644 --- a/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +++ b/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx @@ -47,13 +47,13 @@ const AdvancedTableColumnHeaders = (props) => { return ( -