本帖最后由 kjzy520 于 2018-5-21 17:09 编辑
- 关键代码:
- var source=[{index:1,fileTitle:"标题1"},{index:2,fileTitle:"标题2"}];
- sheet = spread.getSheet(0);
- spread.suspendPaint();
- spreadNS = GC.Spread.Sheets;
- //制表单位
- table = sheet.tables.addFromDataSource("tableRecords", 5, 1, r, spreadNS.Tables.TableThemes.light6);
- table.bandRows(false);//不设置行间样式
- table.filterButtonVisible(false);//不设置过滤
- table.autoGenerateColumns(false);
- var tableColumn1 = new spreadNS.Tables.TableColumn();
- tableColumn1.name("序号").dataField("index");
- var tableColumn2 = new spreadNS.Tables.TableColumn();
- tableColumn2.name("发生时间地点").dataField("fileTitle");
- table.bindColumns([
- tableColumn1,
- tableColumn2,
- ]);
- spread.resumePaint();
复制代码 |