简体   繁体   English

如何使用antd table绘制表格

[英]how to draw table using antd table

I am using Antd table and I have my toys object as below我正在使用 Antd 表,我的玩具对象如下

{
    "Truck": "Black",
    "Bike": "White",
    "Car": "Blue",
    "Bicycle": "Black"
}

Now I want a table using antd table as below.现在我想要一个使用 antd 表的表,如下所示。 Here, the 1st column is text and the second column must be an input field, ie, the color must be editable.在这里,第一列是文本,第二列必须是输入字段,即颜色必须是可编辑的。

Toys玩具 Color颜色
Truck卡车 Black黑色的
Bike自行车 White白色的
Car Blue蓝色
Bicycle自行车 Black黑色的

Can anyone help me to solve this?谁能帮我解决这个问题?

Here is the codesandbox, that I've created for you这是我为你创建的代码和盒子

https://codesandbox.io/s/antd-editable-0izgw https://codesandbox.io/s/antd-editable-0izgw

You need to pass {editable: true} only to make the column editable.您只需要传递{editable: true}才能使列可编辑。

I've take the reference from antd official website.我从antd官方网站上获取了参考。 You can learn more here .您可以在此处了解更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM