Represents a row in a table.
Property | Type | Description |
---|---|---|
index | int | Returns the index number of the row within the rows collection of the table. Zero-indexed. Read-only. |
values | object[][] | Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cell that contain an error will return the error string. |
None
Method | Return Type | Description |
---|---|---|
delete() | void | Deletes the row from the table. |
getRange() | Range | Returns the range object associated with the entire row. |
load(param: object) | void | Fills the proxy object created in JavaScript layer with property and object values specified in the parameter. |
Deletes the row from the table.
tableRowObject.delete();
None
void
var tableName = 'Table1';
var ctx = new Excel.RequestContext();
var row = ctx.workbook.tables.getItem(tableName).tableRows.getItemAt(2);
row.delete();
ctx.executeAsync();
Returns the range object associated with the entire row.
tableRowObject.getRange();
None
var tableName = 'Table1';
var ctx = new Excel.RequestContext();
var row = ctx.workbook.tables.getItem(tableName).tableRows.getItemAt(0);
var rowRange = row.getRange();
ctx.load(rowRange);
ctx.executeAsync().then(function () {
Console.log(rowRange.address);
});
Fills the proxy object created in JavaScript layer with property and object values specified in the parameter.
object.load(param);
Parameter | Type | Description |
---|---|---|
param | object | Optional. Accepts parameter and relationship names as delimited string or an array. Or, provide loadOption object. |
void
var tableName = 'Table1';
var ctx = new Excel.RequestContext();
var row = ctx.workbook.tables.getItem(tableName).tableRows.getItem(0);
ctx.load(row);
ctx.executeAsync().then(function () {
Console.log(row.index);
});
var ctx = new Excel.RequestContext();
var tables = ctx.workbook.tables;
var newValues = [["New", "Values", "For", "New", "Row"]];
var row = ctx.workbook.tables.getItem(tableName).tableRows.getItemAt(2);
row.values = newValues;
ctx.load(row);
ctx.executeAsync().then(function () {
Console.log(row.values);
});