ToJSON

function ToJSON(bWriteNumberings: boolean = null, bWriteStyles: boolean = null): JSON

Description

Converts the ApiTable object into the JSON object.

Parameters

bWriteNumberingsbooleandefault: null

Specifies if the used numberings will be written to the JSON object or not.

bWriteStylesbooleandefault: null

Specifies if the used styles will be written to the JSON object or not.

Returns

JSON

Overloads

ToJSON()

Converts the ApiTablePr object into the JSON object.

Try It

var oDocument = Api.GetDocument();
var oTable = Api.CreateTable(3, 3);
var json = oTable.ToJSON(false, true);
var oTableFromJSON = Api.FromJSON(json);
oTableFromJSON.SetTableBorderTop("single", 32, 0, 51, 51, 51);
oTableFromJSON.SetTableBorderBottom("single", 32, 0, 51, 51, 51);
oTableFromJSON.SetTableBorderLeft("single", 32, 0, 51, 51, 51);
oTableFromJSON.SetTableBorderRight("single", 32, 0, 51, 51, 51);
oTableFromJSON.SetTableBorderInsideV("single", 32, 0, 255, 111, 6);
oTableFromJSON.SetTableBorderInsideH("single", 32, 0, 255, 111, 6);
oTableFromJSON.SetWidth("percent", 100);
oDocument.Push(oTableFromJSON);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).