# Workbook.createCellStyle Method

> Workbook.createCellStyle method in the TX Sheet Control JavaScript API for the browser: Creates a workbook-wide style; returns its stable ID.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > Workbook > Workbook.createCellStyle Method
- **473 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/workbook/createcellstyle-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/workbook/createcellstyle-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/workbook/createcellstyle-method/llms-full.txt

---

Creates a workbook-wide style; returns its stable ID.

Owner: [Workbook](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/workbook/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

### Syntax

```javascript
owner.createCellStyle(name, formatting, includes)
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `name` | `string` | No | Name validated in the owning collection or document scope. |
| `formatting` | `Partial<CellStyle> \| undefined` | Yes | Value matching formatting's declared type and the owning object's validation rules. |
| `includes` | `Record<string, boolean> \| null \| undefined` | Yes | Value matching includes's declared type and the owning object's validation rules. |

### Return Value

`string`.

### Examples

Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.

```javascript
function applyWorkbookCreateCellStyle(book) {
    const workbook = book;
    const result = workbook.createCellStyle('Invoice total', { bold: true, fillColor: '#e5eef4' });
    return result;
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [Workbook Class](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/workbook/llms-full.txt)
- [Formatting and Number Display](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formatting/llms-full.txt)
- [CellStyle Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/cellstyle/llms-full.txt)

---

## Nearby

- **Previous:** [Workbook.consolidate Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/workbook/consolidate-method/llms-full.txt)
- **Next:** [Workbook.createMailMergeTemplate Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/workbook/createmailmergetemplate-method/llms-full.txt)
