Skip to content

Commit 3d24b72

Browse files
authored
Merge pull request #30 from slertness/master
fix: table header style
2 parents 012b68f + 5ac461d commit 3d24b72

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/vc-table/src/TableHeaderRow.jsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ const TableHeaderRow = {
2828
const { column, children, className, ...cellProps } = cell
2929
const cls = cell.class || className
3030
const customProps = column.customHeaderCell ? column.customHeaderCell(column) : {}
31-
if (column.align) {
32-
cellProps.style = { textAlign: column.align }
33-
}
31+
3432
const headerCellProps = mergeProps({
3533
attrs: {
3634
...cellProps,
@@ -40,6 +38,11 @@ const TableHeaderRow = {
4038
...customProps,
4139
key: column.key || column.dataIndex || i,
4240
})
41+
42+
if (column.align) {
43+
headerCellProps.style = { textAlign: column.align }
44+
}
45+
4346
if (typeof HeaderCell === 'function') {
4447
return HeaderCell(h, headerCellProps, children)
4548
}

0 commit comments

Comments
 (0)