0
votes

I am constructing an Excel document using ClosedXML.

I fill the cells with text. When the text is long, it breaks it into several lines in the middle of the word.

How can I make it break into lines only between the words, only on the white spaces?

For example: The word Establishment is broken into 2 and the column width is not changed. I don't want it to break words in two but only in between words and if necessary to increase column width.

enter image description here

1

1 Answers

0
votes

Try this code (c#):

ws.Cells().Style.Alignment.SetWrapText(true);

where ws is the worksheet.