Antd表如何将文本放入几行单元格中

时间:2017-06-15 08:56:27

标签: newline cell break antd

在Antd中有一种方法可以将表格单元格中的文本显示为多行。 我尝试将</br>,\ n,\ r放入文本中。

是否有人已经找到办法做到这一点?

1 个答案:

答案 0 :(得分:2)

Finally here is my solution.

The text for each column contains an \n when there is necessary to have a new line.

After into the table definition I put the style whiteSpace: 'pre':

<Table style={{ whiteSpace: 'pre'}} columns={columns} dataSource={data} title={title} .../>

Thats seems to work as expected.