SetTableLook

function SetTableLook(
  isFirstColumn: boolean = null,
  isFirstRow: boolean = null,
  isLastColumn: boolean = null,
  isLastRow: boolean = null,
  isHorBand: boolean = null,
  isVerBand: boolean = null,
): void

Description

Specifies the conditional formatting components of the referenced table style (if one exists) which will be applied to the set of table rows with the current table-level property exceptions. A table style can specify up to six different optional conditional formats, for example, different formatting for the first column, which then can be applied or omitted from individual table rows in the parent table.

The default setting is to apply the row and column band formatting, but not the first row, last row, first column, or last column formatting.

Parameters

isFirstColumnbooleandefault: null

Specifies that the first column conditional formatting will be applied to the table.

isFirstRowbooleandefault: null

Specifies that the first row conditional formatting will be applied to the table.

isLastColumnbooleandefault: null

Specifies that the last column conditional formatting will be applied to the table.

isLastRowbooleandefault: null

Specifies that the last row conditional formatting will be applied to the table.

isHorBandbooleandefault: null

Specifies that the horizontal band conditional formatting will not be applied to the table.

isVerBandbooleandefault: null

Specifies that the vertical band conditional formatting will not be applied to the table.

Returns

void

Try It

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("We set the table look to override the current table style:");
var oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered"));
var oTable = Api.CreateTable(3, 3);
oTable.SetWidth("percent", 100);
oTable.SetStyle(oTableStyle);
oTable.SetTableLook(true, true, true, true, true, true);
oTableStyle.GetConditionalTableStyle("topLeftCell").GetTableCellPr().SetShd("clear", 255, 111, 61);
oDocument.Push(oTable);

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).