SetNoWrap
Specify how this table cell is laid out when the parent table is displayed in a document. This setting
only affects the behavior of the cell when the ApiTablePr.SetTableLayout table layout for this table is set to use the "autofit"
algorithm.
Parameters:
Name |
Type |
Description |
isNoWrap |
boolean
|
The true value will enable the SetNoWrap method use. |
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered - Accent 5"));
oTable = Api.CreateTable(3, 3);
oTable.SetWidth("percent", 100);
oCell = oTable.GetRow(0).GetCell(0);
oCell.SetNoWrap(true);
oParagraph = oCell.GetContent().GetElement(0);
oParagraph.AddText("The text within this cell is set not to wrap.");
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
builder.SaveFile("docx", "SetNoWrap.docx");
builder.CloseFile();
Resulting document