Example:
$workbook = new cells\Workbook(); $cells = $workbook->getWorksheets()->get(0)->getCells(); for ($i = 0; $i < 5; $i++) { $cells->get(0, $i)->putValue(cells\CellsHelper::columnIndexToName($i)); } for ($row = 1; $row < 10; $row++) { for ($column = 0; $column < 5; $column++) { $cells->get($row, $column)->putValue($row * $column); } } $tables = $workbook->getWorksheets()->get(0)->getListObjects(); $index = $tables->add(0, 0, 9, 4, true); $table = $tables->get(0); $table->setShowTotals(true); $table->getListColumns()->get(4)->setTotalsCalculation(cells\TotalsCalculation::SUM);
Property Getters/Setters Summary | ||
---|---|---|
function | getAlternativeDescription() | |
function | setAlternativeDescription(value) | |
Gets and sets the alternative description. | ||
function | getAlternativeText() | |
function | setAlternativeText(value) | |
Gets and sets the alternative text. | ||
function | getAutoFilter() | |
Gets auto filter.
|
||
function | getComment() | |
function | setComment(value) | |
Gets and sets the comment of the table. | ||
function | getDataRange() | |
Gets the data range of the ListObject.
|
||
function | getDataSourceType() | |
Gets the data source type of the table.
The value of the property is TableDataSourceType integer constant. |
||
function | getDisplayName() | |
function | setDisplayName(value) | |
Gets and sets the display name. | ||
function | getEndColumn() | |
Gets the end column of the range.
|
||
function | getEndRow() | |
Gets the end row of the range.
|
||
function | getListColumns() | |
Gets ListColumns of the ListObject.
|
||
function | getQueryTable() | |
Gets the linked QueryTable.
|
||
function | getShowHeaderRow() | |
function | setShowHeaderRow(value) | |
Gets and sets whether this ListObject show header row. | ||
function | getShowTableStyleColumnStripes() | |
function | ||
Indicates whether column stripe formatting is applied. | ||
function | getShowTableStyleFirstColumn() | |
function | setShowTableStyleFirstColumn(value) | |
Indicates whether the first column in the table should have the style applied. | ||
function | getShowTableStyleLastColumn() | |
function | setShowTableStyleLastColumn(value) | |
Indicates whether the last column in the table should have the style applied. | ||
function | getShowTableStyleRowStripes() | |
function | setShowTableStyleRowStripes(value) | |
Indicates whether row stripe formatting is applied. | ||
function | getShowTotals() | |
function | setShowTotals(value) | |
Gets and sets whether this ListObject show total row. | ||
function | getStartColumn() | |
Gets the start column of the range.
|
||
function | getStartRow() | |
Gets the start row of the range.
|
||
function | getTableStyleName() | |
function | setTableStyleName(value) | |
Gets and sets the table style name. | ||
function | getTableStyleType() | |
function | setTableStyleType(value) | |
Gets and the built-in table style. The value of the property is TableStyleType integer constant. | ||
function | getXmlMap() | |
Gets an |
Method Summary | ||
---|---|---|
function | applyStyleToRange() | |
Apply the table style to the range.
|
||
function | convertToRange() | |
Convert the table to range.
|
||
function | convertToRange(options) | |
Convert the table to range.
|
||
function | filter() | |
Filter the table.
|
||
function | putCellFormula(rowOffset, columnOffset, formula) | |
Put the formula to the cell in the table.
|
||
function | putCellFormula(rowOffset, columnOffset, formula, isTotalsRowFormula) | |
Put the formula to the cell in the table.
|
||
function | putCellValue(rowOffset, columnOffset, value) | |
Put the value to the cell.
|
||
function | putCellValue(rowOffset, columnOffset, value, isTotalsRowLabel) | |
Put the value to the cell.
|
||
function | resize(startRow, startColumn, endRow, endColumn, hasHeaders) | |
Resize the range of the list object.
|
||
function | updateColumnName() | |
Updates all list columns' name from the worksheet.
|
function getStartRow()
function getStartColumn()
function getEndRow()
function getEndColumn()
function getListColumns()
function getShowHeaderRow() / function setShowHeaderRow(value)
function getShowTotals() / function setShowTotals(value)
function getDataRange()
function getQueryTable()
function getDataSourceType()
function getAutoFilter()
function getDisplayName() / function setDisplayName(value)
function getComment() / function setComment(value)
function getShowTableStyleFirstColumn() / function setShowTableStyleFirstColumn(value)
function getShowTableStyleLastColumn() / function setShowTableStyleLastColumn(value)
function getShowTableStyleRowStripes() / function setShowTableStyleRowStripes(value)
function getShowTableStyleColumnStripes() / function setShowTableStyleColumnStripes(value)
function getTableStyleType() / function setTableStyleType(value)
function getTableStyleName() / function setTableStyleName(value)
function getXmlMap()
function getAlternativeText() / function setAlternativeText(value)
function getAlternativeDescription() / function setAlternativeDescription(value)
function resize(startRow, startColumn, endRow, endColumn, hasHeaders)
startRow: Number
- The start row index of the new range.startColumn: Number
- The start column index of the new range.endRow: Number
- The end row index of the new range.endColumn: Number
- The end column index of the new range.hasHeaders: boolean
- Whether this table has headers.function putCellValue(rowOffset, columnOffset, value)
rowOffset: Number
- The row offset in the table.columnOffset: Number
- The column offset in the table.value: Object
- The cell value.function putCellValue(rowOffset, columnOffset, value, isTotalsRowLabel)
rowOffset: Number
- The row offset in the table.columnOffset: Number
- The column offset in the table.value: Object
- The cell value.isTotalsRowLabel: boolean
-
Indicates whether it is a label for total row,only works for total row.
If False and this row is total row, a new row will be inserted.
function putCellFormula(rowOffset, columnOffset, formula)
rowOffset: Number
- The row offset in the table.columnOffset: Number
- The column offset in the table.formula: String
- The formula of the cell.function putCellFormula(rowOffset, columnOffset, formula, isTotalsRowFormula)
rowOffset: Number
- The row offset in the table.columnOffset: Number
- The column offset in the table.formula: String
- The formula of the cell.isTotalsRowFormula: boolean
- function updateColumnName()
function filter()
function applyStyleToRange()
function convertToRange()
function convertToRange(options)
options: TableToRangeOptions
- the options when converting table to range.