I have not tried it, but it seems to me that this is described in the "Creating a table" section:
TableEntry tableEntry = new TableEntry(); FeedURLFactory factory = FeedURLFactory.getDefault(); URL tableFeedUrl = factory.getTableFeedUrl(spreadsheetEntry.getKey()); // Specify a basic table: tableEntry.setTitle(new PlainTextConstruct("New Table")); tableEntry.setWorksheet(new Worksheet("Sheet1")); tableEntry.setHeader(new Header(1)); // Specify columns in the table, start row, number of rows. Data tableData = new Data(); tableData.setNumberOfRows(0); // Start row index cannot overlap with header row. tableData.setStartIndex(2); // This table has only one column. tableData.addColumn(new Column("A", "Column A")); tableEntry.setData(tableData); service.insert(tableFeedUrl, tableEntry);
In particular, the tableEntry.setHeader(new Header(1)) seems to create a heading in the first row. Then tableData.setStartIndex(2) seems to indicate that the data should not go in the first row (since this is the header). Finally, tableData.addColumn(new Column("A", "Column A")) seems to add a column to be marked in the header.
Colind
source share