You can set styles for many areas of a table with the current version of SpreadJS. You can use a built-in style for the entire table or you can set styles for specific areas.
The TableStyles class has a complete list of the built-in table styles.
The following example creates a table and sets the table style using a built-in style.
JavaScript |
|
activeSheet.addTable(“Table1″, 0, 0, 3, 3, GcSpread.Sheets.TableStyles.dark1()); |
Some style methods apply to areas that are not visible or do not have a style setting by default. For example, the lastFooterCellStyle is not displayed unless showFooter is true. The following table lists the SheetTable method that must be true so that the associated table style is displayed in the table.
SheetTable method |
TableStyle method |
bandColumns |
firstColumnStripStyle, firstColumnStripSize, |
bandRows |
firstRowStripSize, firstRowStripStyle, secondRowStripSize, secondRowStripStyle |
highlightFirstColumn |
highlightFirstColumnStyle |
highlightLastColumn |
highlightLastColumnStyle |
showFooter |
lastFooterCellStyle, firstFooterCellStyle, footerRowStyle |
showHeader |
firstHeaderCellStyle, lastHeaderCellStyle, headerRowStyle |
The following example displays a style for the table footer.
JavaScript |
|
$(function () { |
Note: SpreadJS requires a browser that supports HTML5.