How to put a linebreak in a cell

I have some data I want to put in my dhtmlxgrid. The xml looks like this:

This text takes up three lines.

However, in my dhtmlxgrid, I see “This text takes up three lines” all in one cell. How do I make dhtmlx put in the line breaks for me?

Make sure that you have enabled the Multiline support


Yes, I do have mygrid.enableMultiline(true) in my code, and it does automatically wrap text that reaches the end of the cell, but I still cannot put a line break in my text where I want one.

Oh, I see.
In this case you may use CDATA
Like this:

<cell><![CDATA[This text<br/>takes up<br/>three lines]]></cell>

Is there a way to enable mutli line only for a row or cell?

there are some cells that don’t require wrapping so i don’t enable multi line.

however, even if i add a
to the cell value, height would not increase.


You can find the answer to Your question at this sample
Just look at the fiirst row. Columns “Book Title” and “Author”.


another way to do it:


for those row’s you don’t want to apply multiline, force:
grid.setCellTextStyle(rowId, columnIndex, “white-space:nowrap”);