-
Notifications
You must be signed in to change notification settings - Fork 64
/
excel.table.yml
560 lines (535 loc) · 19.7 KB
/
excel.table.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
### YamlMime:TSType
name: Excel.Table
uid: 'excel!Excel.Table:class'
package: excel!
fullName: Excel.Table
summary: >-
Represents an Excel table. To learn more about the table object model, read [Work with tables using the Excel
JavaScript API](https://learn.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables)<!-- -->.
remarks: '\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
type: class
properties:
- name: columns
uid: 'excel!Excel.Table#columns:member'
package: excel!
fullName: columns
summary: Represents a collection of all the columns in the table.
remarks: '\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly columns: Excel.TableColumnCollection;'
return:
type: '<xref uid="excel!Excel.TableColumnCollection:class" />'
- name: context
uid: 'excel!Excel.Table#context:member'
package: excel!
fullName: context
summary: >-
The request context associated with the object. This connects the add-in's process to the Office host
application's process.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'context: RequestContext;'
return:
type: '<xref uid="excel!Excel.RequestContext:class" />'
- name: highlightFirstColumn
uid: 'excel!Excel.Table#highlightFirstColumn:member'
package: excel!
fullName: highlightFirstColumn
summary: Specifies if the first column contains special formatting.
remarks: '\[ [API set: ExcelApi 1.3](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'highlightFirstColumn: boolean;'
return:
type: boolean
- name: highlightLastColumn
uid: 'excel!Excel.Table#highlightLastColumn:member'
package: excel!
fullName: highlightLastColumn
summary: Specifies if the last column contains special formatting.
remarks: '\[ [API set: ExcelApi 1.3](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'highlightLastColumn: boolean;'
return:
type: boolean
- name: id
uid: 'excel!Excel.Table#id:member'
package: excel!
fullName: id
summary: >-
Returns a value that uniquely identifies the table in a given workbook. The value of the identifier remains the
same even when the table is renamed.
remarks: '\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly id: string;'
return:
type: string
- name: name
uid: 'excel!Excel.Table#name:member'
package: excel!
fullName: name
summary: >-
Name of the table.
The set name of the table must follow the guidelines specified in the [Rename an Excel
table](https://support.microsoft.com/office/fbf49a4f-82a3-43eb-8ba2-44d21233b114) article.
remarks: '\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'name: string;'
return:
type: string
- name: rows
uid: 'excel!Excel.Table#rows:member'
package: excel!
fullName: rows
summary: Represents a collection of all the rows in the table.
remarks: '\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly rows: Excel.TableRowCollection;'
return:
type: '<xref uid="excel!Excel.TableRowCollection:class" />'
- name: showBandedColumns
uid: 'excel!Excel.Table#showBandedColumns:member'
package: excel!
fullName: showBandedColumns
summary: >-
Specifies if the columns show banded formatting in which odd columns are highlighted differently from even ones,
to make reading the table easier.
remarks: '\[ [API set: ExcelApi 1.3](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'showBandedColumns: boolean;'
return:
type: boolean
- name: showBandedRows
uid: 'excel!Excel.Table#showBandedRows:member'
package: excel!
fullName: showBandedRows
summary: >-
Specifies if the rows show banded formatting in which odd rows are highlighted differently from even ones, to make
reading the table easier.
remarks: '\[ [API set: ExcelApi 1.3](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'showBandedRows: boolean;'
return:
type: boolean
- name: showFilterButton
uid: 'excel!Excel.Table#showFilterButton:member'
package: excel!
fullName: showFilterButton
summary: >-
Specifies if the filter buttons are visible at the top of each column header. Setting this is only allowed if the
table contains a header row.
remarks: '\[ [API set: ExcelApi 1.3](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'showFilterButton: boolean;'
return:
type: boolean
- name: showHeaders
uid: 'excel!Excel.Table#showHeaders:member'
package: excel!
fullName: showHeaders
summary: Specifies if the header row is visible. This value can be set to show or remove the header row.
remarks: '\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'showHeaders: boolean;'
return:
type: boolean
- name: showTotals
uid: 'excel!Excel.Table#showTotals:member'
package: excel!
fullName: showTotals
summary: Specifies if the total row is visible. This value can be set to show or remove the total row.
remarks: '\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'showTotals: boolean;'
return:
type: boolean
- name: sort
uid: 'excel!Excel.Table#sort:member'
package: excel!
fullName: sort
summary: Represents the sorting for the table.
remarks: '\[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly sort: Excel.TableSort;'
return:
type: '<xref uid="excel!Excel.TableSort:class" />'
- name: style
uid: 'excel!Excel.Table#style:member'
package: excel!
fullName: style
summary: >-
Constant value that represents the table style. Possible values are: "TableStyleLight1" through
"TableStyleLight21", "TableStyleMedium1" through "TableStyleMedium28", "TableStyleDark1" through
"TableStyleDark11". A custom user-defined style present in the workbook can also be specified.
remarks: |-
\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Set table style.
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
table.name = 'Table1-Renamed';
table.showTotals = false;
table.style = 'TableStyleMedium2';
table.load('tableStyle');
await context.sync();
console.log(table.style);
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'style: string;'
return:
type: string
- name: worksheet
uid: 'excel!Excel.Table#worksheet:member'
package: excel!
fullName: worksheet
summary: The worksheet containing the current table.
remarks: '\[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly worksheet: Excel.Worksheet;'
return:
type: '<xref uid="excel!Excel.Worksheet:class" />'
methods:
- name: clearFilters()
uid: 'excel!Excel.Table#clearFilters:member(1)'
package: excel!
fullName: clearFilters()
summary: Clears all the filters currently applied on the table.
remarks: '\[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'clearFilters(): void;'
return:
type: void
description: ''
- name: convertToRange()
uid: 'excel!Excel.Table#convertToRange:member(1)'
package: excel!
fullName: convertToRange()
summary: Converts the table into a normal range of cells. All data is preserved.
remarks: |-
\[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
table.convertToRange();
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'convertToRange(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: delete()
uid: 'excel!Excel.Table#delete:member(1)'
package: excel!
fullName: delete()
summary: Deletes the table.
remarks: |-
\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
table.delete();
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'delete(): void;'
return:
type: void
description: ''
- name: getDataBodyRange()
uid: 'excel!Excel.Table#getDataBodyRange:member(1)'
package: excel!
fullName: getDataBodyRange()
summary: Gets the range object associated with the data body of the table.
remarks: |-
\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
const tableDataRange = table.getDataBodyRange();
tableDataRange.load('address')
await context.sync();
console.log(tableDataRange.address);
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'getDataBodyRange(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: getHeaderRowRange()
uid: 'excel!Excel.Table#getHeaderRowRange:member(1)'
package: excel!
fullName: getHeaderRowRange()
summary: Gets the range object associated with the header row of the table.
remarks: |-
\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
const tableHeaderRange = table.getHeaderRowRange();
tableHeaderRange.load('address');
await context.sync();
console.log(tableHeaderRange.address);
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'getHeaderRowRange(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: getRange()
uid: 'excel!Excel.Table#getRange:member(1)'
package: excel!
fullName: getRange()
summary: Gets the range object associated with the entire table.
remarks: |-
\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
const tableRange = table.getRange();
tableRange.load('address');
await context.sync();
console.log(tableRange.address);
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'getRange(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: getTotalRowRange()
uid: 'excel!Excel.Table#getTotalRowRange:member(1)'
package: excel!
fullName: getTotalRowRange()
summary: Gets the range object associated with the totals row of the table.
remarks: |-
\[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
const tableTotalsRange = table.getTotalRowRange();
tableTotalsRange.load('address');
await context.sync();
console.log(tableTotalsRange.address);
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'getTotalRowRange(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: load(options)
uid: 'excel!Excel.Table#load:member(1)'
package: excel!
fullName: load(options)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'load(options?: Excel.Interfaces.TableLoadOptions): Excel.Table;'
parameters:
- id: options
description: Provides options for which properties of the object to load.
type: '<xref uid="excel!Excel.Interfaces.TableLoadOptions:interface" />'
return:
type: '<xref uid="excel!Excel.Table:class" />'
description: ''
- name: load(propertyNames)
uid: 'excel!Excel.Table#load:member(2)'
package: excel!
fullName: load(propertyNames)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'load(propertyNames?: string | string[]): Excel.Table;'
parameters:
- id: propertyNames
description: A comma-delimited string or an array of strings that specify the properties to load.
type: 'string | string[]'
return:
type: '<xref uid="excel!Excel.Table:class" />'
description: |-
#### Examples
```TypeScript
// Get a table by name.
await Excel.run(async (context) => {
const tableName = 'Table1';
const table = context.workbook.tables.getItem(tableName);
table.load('id')
await context.sync();
console.log(table.id);
});
```
- name: load(propertyNamesAndPaths)
uid: 'excel!Excel.Table#load:member(3)'
package: excel!
fullName: load(propertyNamesAndPaths)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: |-
load(propertyNamesAndPaths?: {
select?: string;
expand?: string;
}): Excel.Table;
parameters:
- id: propertyNamesAndPaths
description: >-
`propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and
`propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load.
type: |-
{
select?: string;
expand?: string;
}
return:
type: '<xref uid="excel!Excel.Table:class" />'
description: ''
- name: reapplyFilters()
uid: 'excel!Excel.Table#reapplyFilters:member(1)'
package: excel!
fullName: reapplyFilters()
summary: Reapplies all the filters currently on the table.
remarks: '\[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'reapplyFilters(): void;'
return:
type: void
description: ''
- name: 'set(properties, options)'
uid: 'excel!Excel.Table#set:member(1)'
package: excel!
fullName: 'set(properties, options)'
summary: >-
Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate
properties, or another API object of the same type.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'set(properties: Interfaces.TableUpdateData, options?: OfficeExtension.UpdateOptions): void;'
parameters:
- id: properties
description: >-
A JavaScript object with properties that are structured isomorphically to the properties of the object on
which the method is called.
type: '<xref uid="excel!Excel.Interfaces.TableUpdateData:interface" />'
- id: options
description: Provides an option to suppress errors if the properties object tries to set any read-only properties.
type: '<xref uid="office!OfficeExtension.UpdateOptions:interface" />'
return:
type: void
description: ''
- name: set(properties)
uid: 'excel!Excel.Table#set:member(2)'
package: excel!
fullName: set(properties)
summary: 'Sets multiple properties on the object at the same time, based on an existing loaded object.'
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'set(properties: Excel.Table): void;'
parameters:
- id: properties
description: ''
type: '<xref uid="excel!Excel.Table:class" />'
return:
type: void
description: ''
- name: toJSON()
uid: 'excel!Excel.Table#toJSON:member(1)'
package: excel!
fullName: toJSON()
summary: >-
Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to
`JSON.stringify()`<!-- -->. (`JSON.stringify`<!-- -->, in turn, calls the `toJSON` method of the object that is
passed to it.) Whereas the original Excel.Table object is an API object, the `toJSON` method returns a plain
JavaScript object (typed as `Excel.Interfaces.TableData`<!-- -->) that contains shallow copies of any loaded child
properties from the original object.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'toJSON(): Excel.Interfaces.TableData;'
return:
type: '<xref uid="excel!Excel.Interfaces.TableData:interface" />'
description: ''
extends: '<xref uid="office!OfficeExtension.ClientObject:class" />'