方式一:customHeaderCell
const columns = [{
title: '今天是\n周一',
dataIndex: `xxx`,
width: 57,
align: 'center',
customHeaderCell: () => {
return {
style: {
whiteSpace: 'pre-wrap',
}
}
}
}]
方式二
/deep/.ant-table-thead>tr>td>th{
white-space:pre-wrap
}
同时title要加\n
const columns = [{
title: '今天是\n周一',
dataIndex: `xxx`,
width: 57,
align: 'center',
}]