JSON API - addTable

addTable

PREMIUM TRIAL / ADVANCED

Adds tables into the Excel spreadsheet.

Note

You are reading the JSON API documentation. For the PHP API method please go to addTable.

JSON data

Contents, and cellStyles from addCell can be used.

Key Description
contents An array with the contents and styles to be added. Check addCell to see all available options.

position Cell position in the active sheet: "A1", "C3", "AB7"...
bandedColumn Banded column option. Default as false.
bandedRow Banded row option. Default as true.
firstColumn First column option. Default as false.
headerRow Header row option. Default as false.
lastColumn Last column option. Default as false.
tableStyle Table style name. MS Excel includes built-in table style names: TableStyleMedium2, TableStyleLight3...
totalRow Total row option. Default as false.
columnNames Custom column names. If not set, "Column " is used to generate names.
columnTotals
  • "cellStyles": check addCell to see all available options.
  • "contentStyles": check addCell to see all available options.
  • "type": "formula", "function", "label".
  • "value": "formula", "function" (average, count, countNums, max, min, stdDev, sum, var), "label". To be used with the previous "type" option.
description Alternative text description.
filters

custom:

  • "andMode": if true, enable 'and' option. Default as false.
  • "operator": equal, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, notEqual.
  • "value": ? (any single character), * (any series of characters).

values

tableName Custom table name. If not set a new table name is generated automatically.
title Alternative text title.
Code samples

Example #1

Example #2

Example #3

Release notes
  • phpxlsx 6.0:
    • new action.