TableDefinition Interface
Operational Excel table; range includes its header and optional totals row.
Package: @txtextcontrol/tx-sheet-control. Version: 2.0.0.
Type-only declaration; it is not a JavaScript runtime constructor.
Members
Properties
| Property | Description |
|---|---|
| columns | The columns value of TableDefinition. |
| emphasizeFirstColumn | The emphasizeFirstColumn value of TableDefinition. |
| emphasizeLastColumn | The emphasizeLastColumn value of TableDefinition. |
| hasFilterButtons | The hasFilterButtons value of TableDefinition. |
| hasHeaderRow | The hasHeaderRow value of TableDefinition. |
| hasTotalsRow | The hasTotalsRow value of TableDefinition. |
| id | The id value of TableDefinition. |
| name | The name value of TableDefinition. |
| range | The range value of TableDefinition. |
| shouldAutoExpand | The shouldAutoExpand value of TableDefinition. |
| showColumnStripes | The showColumnStripes value of TableDefinition. |
| showRowStripes | The showRowStripes value of TableDefinition. |
| style | The style value of TableDefinition. |
| customStyle | A named sparse table recipe. |
Examples
Create sample data and obtain this detached result from the owning document. Return the selected data to the report or application UI.
import type { Workbook } from '@txtextcontrol/tx-sheet-control';
function createTableDefinitionReport(book: Workbook) {
const sheet = book.sheets.at(0);
sheet.range('A7:D9').setValues([
['Description', 'Quantity', 'UnitPrice', 'Amount'],
['Consulting', 3, 120, 360],
['Training', 2, 90, 180],
]);
const table = sheet.tables.add('InvoiceLines', 'A7:D9', {
style: 'TableStyleMedium2',
hasHeaderRow: true,
showRowStripes: true,
});
const result = table.snapshot;
return result;
}