| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
XL.Sheet.AddTable
Adds a table to the sheet with the specified name, range and style.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| XL | 15.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "XL.Sheet.AddTable"; BookRef; SheetIndex; Name; rowFirst; rowLast; ColFirst; ColLast; HasHeaders; tableStyle ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| BookRef | The reference number for the workbook. | $ref |
| SheetIndex | The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. | 0 |
| Name | The name of the new table. | "statistics" |
| rowFirst | The first row for the area. First row has index 0. | $row |
| rowLast | The last row for the area. First row has index 0. | $row |
| ColFirst | The first column for the area. First column has index 0. | $column |
| ColLast | The last column for the area. First column has index 0. | $column+1 |
| HasHeaders | Does the specified range include headers or not. Pass 1 if range incudes headers or 0 if not. |
1 |
| tableStyle | The table style. See the style table here to see what constant name has what look: https://www.libxl.com/table.html |
0 |
Result
Returns table index or error.
Description
Adds a table to the sheet with the specified name, range and style.Returns the table index of the table within the sheet starting with zero.
Please note that these tables are part of a worksheet. If you need a new sheet, you call XL.Book.AddSheet instead.
Table styles:
| Value | Description |
|---|---|
| 0 | No style |
| 1 | Light 1 |
| 2 | Light 2 |
| 3 | Light 3 |
| 4 | Light 4 |
| 5 | Light 5 |
| 6 | Light 6 |
| 7 | Light 7 |
| 8 | Light 8 |
| 9 | Light 9 |
| 10 | Light 10 |
| 11 | Light 11 |
| 12 | Light 12 |
| 13 | Light 13 |
| 14 | Light 14 |
| 15 | Light 15 |
| 16 | Light 16 |
| 17 | Light 17 |
| 18 | Light 18 |
| 19 | Light 19 |
| 20 | Light 20 |
| 21 | Light 21 |
| 22 | Medium 1 |
| 23 | Medium 2 |
| 24 | Medium 3 |
| 25 | Medium 4 |
| 26 | Medium 5 |
| 27 | Medium 6 |
| 28 | Medium 7 |
| 29 | Medium 8 |
| 30 | Medium 9 |
| 31 | Medium 10 |
| 32 | Medium 11 |
| 33 | Medium 12 |
| 34 | Medium 13 |
| 35 | Medium 14 |
| 36 | Medium 15 |
| 37 | Medium 16 |
| 38 | Medium 17 |
| 39 | Medium 18 |
| 40 | Medium 19 |
| 41 | Medium 20 |
| 42 | Medium 21 |
| 43 | Medium 22 |
| 44 | Medium 23 |
| 45 | Medium 24 |
| 46 | Medium 25 |
| 47 | Medium 26 |
| 48 | Medium 27 |
| 49 | Medium 28 |
| 50 | Dark 1 |
| 51 | Dark 2 |
| 52 | Dark 3 |
| 53 | Dark 4 |
| 54 | Dark 5 |
| 55 | Dark 6 |
| 56 | Dark 7 |
| 57 | Dark 8 |
| 58 | Dark 9 |
| 59 | Dark 10 |
| 60 | Dark 11 |
Examples
Define a table:
Set Variable [ $table ; Value: MBS( "XL.Sheet.AddTable"; $book; $sheet; "test"; 15; 20; 1; 3; 0; 30 /* medium 16 */ ) ]
See also
Release notes
- Version 15.2
- Added XL.Sheet.AddTable to add a table to a sheet.
Blog Entries
This function checks for a license.
Created 5th April 2025, last changed 22nd January 2026