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:
ValueDescription
0No style
1Light 1
2Light 2
3Light 3
4Light 4
5Light 5
6Light 6
7Light 7
8Light 8
9Light 9
10Light 10
11Light 11
12Light 12
13Light 13
14Light 14
15Light 15
16Light 16
17Light 17
18Light 18
19Light 19
20Light 20
21Light 21
22Medium 1
23Medium 2
24Medium 3
25Medium 4
26Medium 5
27Medium 6
28Medium 7
29Medium 8
30Medium 9
31Medium 10
32Medium 11
33Medium 12
34Medium 13
35Medium 14
36Medium 15
37Medium 16
38Medium 17
39Medium 18
40Medium 19
41Medium 20
42Medium 21
43Medium 22
44Medium 23
45Medium 24
46Medium 25
47Medium 26
48Medium 27
49Medium 28
50Dark 1
51Dark 2
52Dark 3
53Dark 4
54Dark 5
55Dark 6
56Dark 7
57Dark 8
58Dark 9
59Dark 10
60Dark 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

Blog Entries

This function checks for a license.

Created 5th April 2025, last changed 22nd January 2026


XL.Sheet.AddSelectionRange - XL.Sheet.AddrToRowCol