TableBinding object (JavaScript API for Office)

Office Add-ins

Represents a binding in two dimensions of rows and columns, optionally with headers.

Last modified: July 06, 2015

Note Note

The name "apps for Office" is changing to "Office Add-ins". During the transition, the documentation and the UI of some Office host applications and Visual Studio tools might still use the term "apps for Office". For details, see New name for apps for Office and SharePoint.

Hosts:

Access, Excel, PowerPoint, Project, Word

Available in Requirement set

TableBindings

Last changed in Selection

1.1

See all support details

TableBinding

Properties

Name

Description

Updates for Office.js v1.1

columnCount

Gets the number of columns in the specified TableBinding object.

Added support for table binding in content apps for Access.

hasHeaders

If the specified TableBinding has headers, returns true; otherwise false.

Added support for table binding in content apps for Access.

rowCount

The number of rows in the specified TableBinding object.

For performance reasons, always returns -1 in content apps for Access.

Methods

Name

Description

Updates for Office.js v1.1

addColumnsAsync

Adds columns and values to a table.

addRowsAsync

Adds rows and values to a table.

Added support for table binding in content apps for Access.

clearFormatsAsync

Clears formatting on the bound table.

New in Office.js v1.1 for apps for Excel.

deleteAllDataValuesAsync

Deletes all non-header rows and their values in the table, shifting appropriately for the host application.

Added support for table binding in content apps for Access.

setDataAsync

Writes data to the bound section of the document represented by the specified binding object.

  • Added support for table binding in content apps for Access.

  • Added support for setting formatting when writing data to bound tables in apps for Excel.

setFormatsAsync

Sets cell and table formatting on specified items and data in the bound table.

Can set table formatting in apps for Excel.

setTableOptionsAsync

Updates table formatting options on the bound table.

Can set table formatting in apps for Excel.

The TableBinding object inherits the id property, type property, getDataAsync method, and setDataAsync method from the Binding abstract object.

After you establish a table binding in Excel, each new row a user adds to the table is automatically included in the binding (rowCount will increase).

A checkmark (√) in the following matrix indicates that this object is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this object.

For more information about Office host application and server requirements, see Requirements for running apps for Office.

Supported hosts, by platform

Office for Windows desktop

Office Online
(in browser)

Office for iPad

Access

Excel

Word

Available in requirement sets

TableBindings

Minimum permission level

WriteDocument

App types

Content, task pane

Library

Office.js

Namespace

Office

Version

Changes

1.1

Added support for Excel and Word in Office for iPad.

1.1

Added support for setting formatting when inserting tables in Excel.

1.1

Added support for apps for Access.

1.0

Introduced

Show:
© 2015 Microsoft