Edit this page

Appearance

By default, Excel shows all cells according to their default font settings—color, font name, and size.

Customization

Configuration Options

Kendo UI allows you to change the appearance of the cells via the following configuration options:

  • background—This option sets the background color of the cell.
  • bold—Displays the cell value in bold.
  • color—Sets the cell text color.
  • fontName—Sets the font used to display the cell value.
  • fontSize—Sets the font size of the cell value.
  • hAlign—Sets the horizontal text alignment.
  • italic—Displays the cell value in italic.
  • underline—Displays the cell value as underlined.
  • vAlign—Sets the vertical text alignment.

The example below demonstrates how to customize the appearance of the cells.

Example
<script>
var workbook = new kendo.ooxml.Workbook({
  sheets: [
    {
      columns: [ { autoWidth: true } ],
      rows: [
        {
          cells: [
            {
              value: "bold and italic",
              bold: true,
              italic: true
            }
          ]
        },
        {
          cells: [
            {
              value: "red text on blue background",
              color: "#ff0000",
              background: "#0000ff"
            }
          ]
        },
        {
          cells: [
            {
              value: "Arial 20px",
              fontSize: 20,
              fontName: "Arial"
            }
          ]
        },
        {
          cells: [
            {
              value: "Right aligned",
              hAlign: "right"
            }
          ]
        },
        {
          cells: [
            {
              value: "Centered horizontally and vertically",
              vAlign: "center",
              hAlign: "center",
              rowSpan: 2
            }
          ]
        }
      ]
    }
  ]
});
kendo.saveAs({
    dataURI: workbook.toDataURL(),
    fileName: "Test.xlsx"
});
</script>

See Also

Articles on the Excel export functionality in Kendo UI:

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy