This sample demonstrates the Spreadsheet cell formatting feature by applying different styles to a range of cells.
Cell formatting allows you to highlight cell data that appears in the Spreadsheet. It can be enabled or disabled using the allowCellFormatting property.
In this sample, gridlines are hidden using the showGridLines property and the styles are applied using the style property and cellFormat method.
Additionally, rich text formatting like subscript and superscript are applied to emphasize parts of the data, improving readability and presentation.
To improve performance, suspendRefresh method is invoked before applying formatting, which temporarily pauses UI rendering while updates are made. After all formatting is completed, resumeRefresh method is invoked to render all changes at once, ensuring smoother performance.
Key Features
- Cell formatting - Apply visual styles to cells and ranges to improve data presentation and readability.
- Text formatting - Customize fonts, colors, alignment, indentation, and text decorations for worksheet content.
- Border customization - Add and customize cell borders to organize and highlight worksheet data.
- Rich text support - Apply different font properties like bold, italic, underline, subscript and superscript rich text formatting within cell content.
- Range formatting - Apply consistent formatting across multiple cells and ranges efficiently.
Learn how to apply styles, borders, and rich text formatting to cells, as demonstrated in this sample.
Documentation Links
More Resource