html表单按钮底部居中,Ant design StepsForm中如何使底部按钮居中

bVcPpLS

如图所示,当前有一个StepsForm表单,代码如下(基本就是官网的示例修改的)const Demo: React.FC = () => {

const Option = [

{

key: '1',

value: '111',

label: '个人'

},

{

key: '2',

value: '222',

label: '合作'

},

]

const waitTime = (time: number = 100) => {

return new Promise((resolve) => {

setTimeout(() => {

resolve(true);

}, time);

});

};

return (

<>

name: string;

}>

onFinish={async (values) => {

console.log(values);

await waitTime(1000);

message.success('提交成功');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据您提供的引用内容,我了解到您想要将antd table的summary文字居中。您可以通过自定义样式来实现这个效果。具体步骤如下: 1. 在columns添加一个自定义的render函数,用于渲染summary文字。 2. 在render函数,使用HTML的<span>标签来包裹summary文字,并为该<span>标签添加一个自定义的类名,例如"summary-text"。 3. 在CSS样式文件,使用该自定义类名来设置文字居中的样式。 以下是一个示例代码: ```javascript import React from 'react'; import { Table } from 'antd'; import './styles.css'; const columns = [ { title: 'Name', dataIndex: 'name', key: 'name', }, { title: 'Age', dataIndex: 'age', key: 'age', }, { title: 'Address', dataIndex: 'address', key: 'address', }, { title: 'Summary', key: 'summary', render: () => <span className="summary-text">Summary Text</span>, }, ]; const data = [ { key: '1', name: 'John Brown', age: 32, address: 'New York No. 1 Lake Park', }, { key: '2', name: 'Jim Green', age: 42, address: 'London No. 1 Lake Park', }, { key: '3', name: 'Joe Black', age: 32, address: 'Sidney No. 1 Lake Park', }, ]; const App = () => ( <Table columns={columns} dataSource={data} /> ); export default App; ``` 在上述代码,我们在render函数使用了一个自定义的类名"summary-text"来设置summary文字的样式。然后,在styles.css文件,您可以添加以下样式代码来实现文字居中的效果: ```css .summary-text { text-align: center; } ``` 这样,您就可以将antd table的summary文字居中了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值