Antd Table组件的头部单元格水平居中🧐
const columns1 = [
{
dataIndex: 'title',
title: '栏目名称',
width: '150px',
},
{
dataIndex: 'show',
title: '是否展示',
width: '620px',
customHeaderCell: () => ({
style: {
textAlign: 'center', //头部单元格水平居中
},
}),
},
{
dataIndex: 'align',
title: '居中方式',
width: 200,
scopedSlots: { customRender: 'alignAlias' },
align: 'center', //头部单元格和列内容水平居中
}
]
实测简单好用!
本人只是记录工作过程中遇到的一些比较不常见的需求,来作为记录!