SpreadJS Documentation
addTableByDataSource Method
The table name.
The row index.
The column index.
The data source for the table.
The style of the table.
Adds a range table with a specified data source to the sheet.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var value; // Type: SheetTable
value = instance.addTableByDataSource(name, row, column, datasource, style);
function addTableByDataSource( 
   name : string,
   row : number,
   column : number,
   datasource : object,
   style : TableStyle
) : SheetTable;

Parameters

name
The table name.
row
The row index.
column
The column index.
datasource
The data source for the table.
style
The style of the table.

Return Value

The new table instance.
Example
This example creates a table.
var source = [
                { LastName: "Freehafer", FirstName: "Nancy", Title: "Sales Representative", Phone: "(123)555-0100"},
                { LastName: "Cencini", FirstName: "Andrew", Title: "Vice President, Sales", Phone: "(123)555-0101"},
                { LastName: "Kotas", FirstName: "Jan", Title: "Sales Representative", Phone: "(123)555-0102"},
                { LastName: "Sergienko", FirstName: "Mariya", Title: "Sales Representative", Phone: "(123)555-0103"},
            ];
            
            activeSheet.addTableByDataSource("Table1", 5, 2, source, GcSpread.Sheets.TableStyles.dark1());
See Also

Reference

Sheet type
Creating Tables

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.