Get Started
Usage API
More information

ToJSON

ToJSON() → { JSON }

Inherited From: ApiTableCellPr.ToJSON

Converts the ApiTableCellPr object into the JSON object.

Parameters:

This method doesn't have any parameters.

Returns:

Type
JSON

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTable = Api.CreateTable(3, 3);
oDocument.Push(oTable);
oTable.SetTableBorderTop("single", 32, 0, 0, 0, 255);
oTable.SetTableBorderBottom("single", 32, 0, 0, 0, 255);
oTable.SetTableBorderLeft("single", 32, 0, 0, 0, 255);
oTable.SetTableBorderRight("single", 32, 0, 0, 0, 255);
oTable.SetTableBorderInsideV("single", 32, 0, 255, 0, 0);
oTable.SetTableBorderInsideH("single", 32, 0, 255, 0, 0);
oTable.SetWidth("percent", 100);
var oCell = oTable.GetCell(0,0);
var sJSON = oCell.ToJSON();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("The ApiTableCell object in the JSON format: ").SetBold(true);
oParagraph.AddLineBreak();
oParagraph.AddText(sJSON);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "ToJSON.docx");
builder.CloseFile();

Resulting document