newlinecellbreakantd

Antd table how to put text into cell in several lines


In Antd is there a way to show the text in table cell into several lines. I try to put </br>, \n, \r into the text.

Is there someone who has already find a way to do that?


Solution

  • 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.