Overview

SpreadJS supports rich text. You can show superscript, subscript and different text styles in one cell. The editor on the right can be used to create text with different styles.

Description
app.js
index.html
styles.css
Copy to CodeMine

Rich text data is an anonymous object, you should follow the JSON Schema.

You can set the value for the specified cell in the specified sheet area using the following code:

    sheet.setValue(0,2,{richText:[{style:{font:'bold 24px Arial'},text:'SpreadJS'}]}, GC.Spread.Sheets.SheetArea.colHeader);
    sheet.setValue(2,0,{richText:[{style:{font:'bold 24px Arial'},text:'SpreadJS'}]}, GC.Spread.Sheets.SheetArea.rowHeader);
    sheet.setValue(2,0,{richText:[{style:{font:'bold 24px Arial'},text:'SpreadJS'}]}, GC.Spread.Sheets.SheetArea.viewport);

You can get the unformatted data from the specified cell in the specified sheet area using the following code:

    sheet.getValue(1, 1, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.ValueType.richText);

Updated: Rich text now support list

    sheet.setValue(3, 0, {
        richText:[{
            type: GC.Spread.Sheets.ListType.disc,
            level: 0,
            richText: [{
                style:{font:'bold 24px Arial'},
                text:'SpreadJS'
            }]
        }]}, GC.Spread.Sheets.SheetArea.viewport);
Rich text data is an anonymous object, you should follow the JSON Schema. You can set the value for the specified cell in the specified sheet area using the following code: You can get the unformatted data from the specified cell in the specified sheet area using the following code: Updated: Rich text now support list