New to Kendo UI for Vue? Start a free 30-day trial

Cell Formatting

Updated on Nov 26, 2026

The Kendo UI for Vue Spreadsheet lets users and developers control how the cells look. You can apply number formats, fonts, colors, alignment, borders, text wrapping, and merged cells through the toolbar, the JSON data of the sheets, or the methods of a range.

Example
View Source
Loading ...

Formatting Through the Toolbar

The default toolbar groups the formatting tools in the following tabs:

TabTools
HomeFont, font size, Bold, Italic, Underline, text color, background, borders, horizontal and vertical alignment, and text wrap.
FormatThe number format, Decrease decimal, Increase decimal, and Clean formatting.
ViewMerge cells, which is next to the tools for freezing panes and toggling the grid lines.

The borders tool offers all borders, inside borders (all, horizontal, or vertical), outside borders, left, top, right, and bottom borders, and no borders. The merge tool offers merging all cells, merging horizontally, merging vertically, and unmerging.

Number Formats

The Format tool of the toolbar changes how the value of a cell is displayed without changing the value itself. The tool offers the following predefined formats:

NameFormat code
AutomaticRemoves the format.
Text@
Number#,0.00
Percent0.00%
Financial_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)
Currency$#,##0.00;[Red]$#,##0.00
Datem/d/yyyy
Timeh:mm:ss AM/PM
Date timem/d/yyyy h:mm
Duration[h]:mm:ss

The Increase decimal and Decrease decimal tools add or remove a decimal place of the current format.

You are not limited to the predefined formats. Set any Excel-style format code through the format field of a cell or the format() method of a range:

js
// In the JSON data.
{ value: 5400.5, format: '$#,##0.00' }
{ value: 45672, format: 'mmm d, yyyy' } // Dates are stored as serial numbers, as in Excel.

// From code.
spreadsheetRef.value.activeSheet().range('C3:C6').format('0.00%');

To translate the names of the predefined formats in the Format tool, use the spreadsheet.formatAutomatic, spreadsheet.formatText, spreadsheet.formatNumber, spreadsheet.formatPercent, spreadsheet.formatFinancial, spreadsheet.formatCurrency, spreadsheet.formatDate, spreadsheet.formatTime, spreadsheet.formatDateTime, and spreadsheet.formatDuration globalization messages. The format codes stay the same.

Formatting Through JSON Data

Set the formatting of a cell through its fields when you define the sheets:

FieldDescription
formatThe number format code of the cell.
fontFamily and fontSizeThe font and the font size of the text.
bold, italic, and underlineSet to true to apply the corresponding font style.
color and backgroundThe text color and the background color, for example 'rgb(0,62,117)' or '#003e75'.
textAlignThe horizontal alignment—'left', 'center', 'right', or 'justify'.
verticalAlignThe vertical alignment—'top', 'center', or 'bottom'.
wrapSet to true to wrap long text in multiple lines.
indentThe indentation of the text.
borderTop, borderRight, borderBottom, and borderLeftThe borders of the cell, defined as { size: 1, color: '#000000' }.

The merged cells are defined at the level of the sheet through the mergedCells field:

js
const sheets = [
    {
        name: 'Sales',
        mergedCells: ['A1:E1'],
        rows: [
            {
                height: 36,
                cells: [
                    {
                        value: 'Quarterly sales report',
                        bold: true,
                        fontSize: 18,
                        textAlign: 'center',
                        verticalAlign: 'center',
                        color: 'rgb(0,62,117)'
                    }
                ]
            },
            {
                cells: [
                    { value: 'Chai', bold: true, borderBottom: { size: 1, color: 'rgb(0,62,117)' } },
                    { value: 0.12, format: '0.00%', textAlign: 'center' }
                ]
            }
        ]
    }
];

Formatting Through Code

Use the methods of a range to read or change the formatting at runtime. The setter methods return the range, so you can chain the calls:

js
const sheet = spreadsheetRef.value.activeSheet();

sheet.range('A1:E1').background('rgb(0,62,117)').color('rgb(255,255,255)').bold(true);
sheet.range('B3:B6').textAlign('center');
sheet.range('E3').wrap(true);
sheet.range('A1:E1').merge();

sheet.range('A1').bold(); // Returns the current value.
sheet.range('A1:E1').unmerge();
sheet.range('A3:E6').clearFormat(); // Removes the formatting but keeps the values.

For the full list of the range methods, see Methods of the Spreadsheet.