{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-cell-formatting",
  "framework": "angular",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "cell-formatting",
  "dependencies": [
    "@syncfusion/ej2-angular-spreadsheet"
  ],
  "description": "Spreadsheet sample demonstrating cell formatting feature by applying different styles to a range of cells.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/angular/llms.txt",
    "skillPack": "syncfusion/angular-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/angular/spreadsheet-editor-cell-formatting.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-cell-formatting/spreadsheet-editor.component.html",
      "content": "<div class=\"control-section\">\n    <ejs-spreadsheet #cellFormat [showRibbon]=\"false\" [showFormulaBar]=\"false\"\n        (created)=\"created()\" (beforeCellRender)=\"beforeCellRender($event)\">\n        <e-sheets>\n            <e-sheet name=\"Order Details\" [showGridLines]=\"false\">\n                <e-ranges>\n                    <e-range [dataSource]=\"data\"></e-range>\n                </e-ranges>\n                <e-columns>\n                    <e-column [width]=\"80\"></e-column>\n                    <e-column [width]=\"130\"></e-column>\n                    <e-column [width]=\"180\"></e-column>\n                    <e-column [width]=\"90\"></e-column>\n                    <e-column [width]=\"160\"></e-column>\n                    <e-column [width]=\"80\"></e-column>\n                    <e-column [width]=\"100\"></e-column>\n                    <e-column [width]=\"130\"></e-column>\n                    <e-column [width]=\"80\"></e-column>\n                </e-columns>\n            </e-sheet>\n        </e-sheets>\n    </ejs-spreadsheet>\n</div>"
    },
    {
      "target": "src/components/spreadsheet-editor-cell-formatting/spreadsheet-editor.component.ts",
      "content": "import { Component, ViewEncapsulation, ViewChild } from '@angular/core';\nimport { SpreadsheetComponent, SpreadsheetModule } from '@syncfusion/ej2-angular-spreadsheet';\nimport { CellRenderEventArgs } from '@syncfusion/ej2-angular-spreadsheet';\nimport { orderDetails } from '../datasource/spreadsheet-editor-data';\n/**\n * Cell Formatting Spreadsheet Component\n */\n@Component({\n    selector: 'control-content',\n    templateUrl: 'spreadsheet-editor.component.html',\n    encapsulation: ViewEncapsulation.None,\n    standalone: true,\n    imports: [SpreadsheetModule]\n})\n\nexport class CellFormattingController {\n    @ViewChild('cellFormat')\n    public spreadsheetObj!: SpreadsheetComponent;\n    public data: Object[] = orderDetails();\n    created() {\n        // Temporarily suspends UI rendering to batch model updates for better performance.\n        this.spreadsheetObj.suspendRefresh();\n        //Applying cell formatting dynamically using cellFormat method.\n        this.spreadsheetObj.cellFormat({ fontWeight: 'bold', backgroundColor: '#4b5366', color: '#ffffff', fontSize: '12pt' }, 'A1:J1');\n        this.spreadsheetObj.cellFormat({ fontWeight: 'bold', textIndent: '2pt' }, 'B2:B16');\n        this.spreadsheetObj.cellFormat({ fontStyle: 'italic', textIndent: '2pt' }, 'E2:E16');\n        this.spreadsheetObj.cellFormat({ textIndent: '2pt' }, 'F1:F16');\n        this.spreadsheetObj.cellFormat({ textIndent: '2pt' }, 'G1:G16');\n        this.spreadsheetObj.cellFormat({ textAlign: 'center', fontWeight: 'bold' }, 'I2:I16');\n        this.spreadsheetObj.cellFormat({ fontFamily: 'Helvetica New', verticalAlign: 'middle' }, 'A1:J16');\n        //Applying border to a range\n        this.spreadsheetObj.setBorder({ border: '1px solid #e0e0e0' }, 'A1:J16', 'Outer');\n        this.spreadsheetObj.setBorder({ border: '1px solid #e0e0e0' }, 'A2:J15', 'Horizontal');\n        // Applying a short date format to a range.\n        this.spreadsheetObj.numberFormat('m/d/yyyy', 'D2:D16');\n        // Applying currency format to a range.\n        this.spreadsheetObj.numberFormat('$#,##0.00', 'J2:J16');\n        // Applying subscript and superscript format.\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: 'Mineral Water H' },\n                { text: '2', style: { verticalAlign: 'sub' } },\n                { text: 'O' }\n            ] }, 'C2');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: 'Energy Supplement C' },\n                { text: '6', style: { verticalAlign: 'sub' } },\n                { text: 'H' },\n                { text: '12', style: { verticalAlign: 'sub' } },\n                { text: 'O' },\n                { text: '6', style: { verticalAlign: 'sub' } }\n            ] }, 'C4');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: 'Refrigerant Gas CO' },\n                { text: '2', style: { verticalAlign: 'sub' } }\n            ] }, 'C6');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: 'Water Purifier H' },\n                { text: '2', style: { verticalAlign: 'sub' } },\n                { text: 'O System' }\n            ] }, 'C10');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: 'n' },\n                { text: 'o', style: { verticalAlign: 'super' } },\n                { text: ' 59 rue de l Abbaye' }\n            ] }, 'E2');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: '2' },\n                { text: 'e', style: { verticalAlign: 'super' } },\n                { text: ' rue du Commerce' }\n            ] }, 'E5');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: '22' },\n                { text: 'nd', style: { verticalAlign: 'super' } },\n                { text: ' Carrera con Ave. Carlos Soublette' }\n            ] }, 'E7');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: '2' },\n                { text: 'o', style: { verticalAlign: 'super' } },\n                { text: ' Calle del Rosal' }\n            ] }, 'E9');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: '3' },\n                { text: 'rd', style: { verticalAlign: 'super' } },\n                { text: ' 55 Grizzly Peak Rd.' }\n            ] }, 'E11');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: '5' },\n                { text: 'th', style: { verticalAlign: 'super' } },\n                { text: ' 2817 Milton Dr.' }\n            ] }, 'E13');\n        this.spreadsheetObj.updateCell({ richText: [\n                { text: 'Kirchgasse 6' }\n            ] }, 'E15');\n        // Resume UI rendering after batch model updates.\n        this.spreadsheetObj.resumeRefresh();\n    }\n\n    beforeCellRender(args: CellRenderEventArgs) {\n        // Prevents the cell formatting to be applied to the headers.\n        if (args.address.includes('1')) {\n            args.element.classList.add('e-header-cell');\n        }\n    }\n}"
    }
  ]
}