SpreadJS Documentation > Developer's Guide > Managing the User Interface > Using Tables > Setting Table Styles |
You can use a built-in style for the entire table or you can set styles for specific areas of the table such as rows or columns.
Refer to the TableStyles class for a list of built-in styles. Refer to the TableStyle class for styles that can be set for specific areas.
Some style properties 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.
This example creates a table and sets the table style using a built-in style.
JavaScript |
Copy Code
|
---|---|
activeSheet.addTable("Table1", 0, 0, 3, 3, GcSpread.Sheets.TableStyles.dark1()); activeSheet.getCell(0,0).text("Name"); activeSheet.getCell(0,1).text("Value"); activeSheet.getCell(0,2).text("T/F"); activeSheet.getCell(1,0).text("AW"); activeSheet.getCell(1,1).text("5"); activeSheet.getCell(1,2).text("T"); |
This example displays a style for the table footer.
JavaScript |
Copy Code
|
---|---|
$(function () { //Add data |