diff --git a/src/Table.js b/src/Table.js index f76928e..de9b807 100644 --- a/src/Table.js +++ b/src/Table.js @@ -480,7 +480,8 @@ class Table extends Component { fixed: column.fixed, width: width, dataindex:column.dataIndex, - textAlign:column.textAlign + textAlign:column.textAlign, + titleAlign: column.titleAlign, // 标题水平对齐方式 }; if (column.onHeadCellClick) { cell.onClick = column.onHeadCellClick; diff --git a/src/TableCell.js b/src/TableCell.js index ef4e628..332ed3e 100644 --- a/src/TableCell.js +++ b/src/TableCell.js @@ -125,7 +125,10 @@ class TableCell extends Component{ if(column.fixed && !fixed){ className = className+` ${clsPrefix}-fixed-columns-in-body`; } - if(column.textAlign){ + if(column.contentAlign){ + className = className+` text-${column.contentAlign}`; + } + else if(column.textAlign){ className = className+` text-${column.textAlign}`; } if(typeof text == 'string' && bodyDisplayInRow){ diff --git a/src/TableHeader.js b/src/TableHeader.js index 2b75b8d..2fa66f7 100644 --- a/src/TableHeader.js +++ b/src/TableHeader.js @@ -745,10 +745,15 @@ class TableHeader extends Component { canDotDrag = "th-can-not-drag"; } let thClassName = `${da.className}`?`${da.className}`:''; - if(da.textAlign){ + if(da.titleAlign){ + thClassName += ` text-${da.titleAlign} `; + } + else if(da.textAlign){ thClassName += ` text-${da.textAlign} `; } + delete da.textAlign; + delete da.titleAlign; const keyTemp = {}; //避免key为undefined // if(da.dataindex && da.key ===undefined ){