Antd Table组件的头部单元格水平居中

const columns = [
    {
        dataIndex: 'districtName',
        title: '区县',
        width: 150,
    },
    {
        dataIndex: 'sendContent',
        title: '发送内容',
        width: 620,
        customHeaderCell: () => ({
            style: {
                textAlign: 'center',  //头部单元格水平居中
            },
        }),
    },
    {
        dataIndex: 'sendStatus',
        title: '短信发送状态',
        width: 200,
        scopedSlots: { customRender: 'sendStatus' },
        align: 'center', //头部单元格和列内容水平居中
    },
]
posted @ 2022-07-07 13:49  赵辉Coder  阅读(2079)  评论(0)    收藏  举报