摘抄 antdv table 表头标题换行及自定义样式_antd table header 换行-CSDN博客
{
title: () => `范围 \n(${this.curUnit})`,
dataIndex: 'o73',
key: 'o73',
align: 'center',
width: 280,
},
方式一:customHeaderCell
{
title: () => `范围 \n(${this.curUnit})`,
dataIndex: 'o73',
key: 'o73',
align: 'center',
width: 280,
customHeaderCell: () => {
return {
style: {
whiteSpace: 'pre-wrap',
}
}
}
},
方式二:
/deep/.ant-table-thead > tr > th .ant-table-header-column {
white-space: pre-wrap;
}
注意: 同时title要加\n
title: '今天是\n周一',