Set alignment properties (horizontal, vertical, wrap text, rotation, indent).
build writes horizontal, vertical, wrapText, textRotation, indent and
shrinkToFit; readingOrder, justifyLastLine and relativeIndent are not carried over.
Alignment options to merge into the current alignment.
this for chaining.
Set border styles and colors for each side (left, right, top, bottom).
Border definitions for each side.
this for chaining.
Build the style and register it in the given styles data object.
Equal fonts, fills, borders and cell formats are reused, so identical builds return the
same index; an entry that differs from every existing one is appended.
A number format code already in styles.numFmts is reused; a new code gets the id after
the highest existing one (at least 164). Without numberFormat the format is General (id 0).
The workbook's shared StylesData (typically wb.styles).
The zero-based style index to assign to cell.styleIndex.
Set fill properties (pattern type, foreground color, background color).
Fill options with pattern type and colors as hex RGB (RRGGBB) or ARGB (AARRGGBB) strings, with or without a leading #, written as uppercase ARGB (FF alpha added for RRGGBB) and read back in that form.
this for chaining.
Set font properties (name, size, bold, italic, color, etc.).
build writes name, size, bold, italic, underline, strike and color,
with 'Calibri', 11, false and no colour as the defaults; the other FontData members
(underlineStyle, colorSpec, vertAlign, ...) are not carried into the built font.
Partial font data to merge into the current font.
this for chaining.
Set cell protection properties (locked, hidden).
An unset locked is written as true and an unset hidden as false.
Protection options.
this for chaining.
Fluent builder for constructing cell styles (font, fill, border, alignment, etc.).
Chain setter methods then call build to register the style in a
StylesDataobject and obtain a reusable style index.Example