TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

FormatAsTable

FormatAsTable(sRange)

Formats the selected range of cells from the current sheet as a table (with the first row formatted as a header). As the first row is always formatted as a table header, you need to select at least two rows for the table to be formed correctly.

Parameters:

Name Type Description
sRange string

The range of cells from the current sheet which will be formatted as a table.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oWorksheet.FormatAsTable("A1:E10");
builder.SaveFile("xlsx", "FormatAsTable.xlsx");
builder.CloseFile();

Resulting document