How to show 2 line in one column in datatable?

后端 未结 3 1558
广开言路
广开言路 2021-02-08 08:02

I have a data table in my application. One column have heavy data which increasing the width of table.

I want to split the data to two or more lines in that column.

3条回答
  •  旧巷少年郎
    2021-02-08 09:05

    The .ui-datatable tbody td has a default style of white-space: nowrap, meaning that long texts won't wrap. You want to override this style by setting it back to white-space: normal.

    E.g.

    
    

    with this CSS

    .ui-datatable tbody td.wrap {
        white-space: normal;
    }
    

    See also:

    • How do I override default PrimeFaces CSS with custom styles?

提交回复
热议问题