From 5ac461df07be5cbb058aa0920ec57382b906855d Mon Sep 17 00:00:00 2001 From: "set.zhao" <set.zhao@ti-or.com> Date: Sun, 3 Jun 2018 23:35:19 +0800 Subject: [PATCH] fix table header style --- components/vc-table/src/TableHeaderRow.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/vc-table/src/TableHeaderRow.jsx b/components/vc-table/src/TableHeaderRow.jsx index 618bae948..d485f3532 100644 --- a/components/vc-table/src/TableHeaderRow.jsx +++ b/components/vc-table/src/TableHeaderRow.jsx @@ -28,9 +28,7 @@ const TableHeaderRow = { const { column, children, className, ...cellProps } = cell const cls = cell.class || className const customProps = column.customHeaderCell ? column.customHeaderCell(column) : {} - if (column.align) { - cellProps.style = { textAlign: column.align } - } + const headerCellProps = mergeProps({ attrs: { ...cellProps, @@ -40,6 +38,11 @@ const TableHeaderRow = { ...customProps, key: column.key || column.dataIndex || i, }) + + if (column.align) { + headerCellProps.style = { textAlign: column.align } + } + if (typeof HeaderCell === 'function') { return HeaderCell(h, headerCellProps, children) }