Skip to content
Julian Halliwell edited this page Mar 8, 2017 · 14 revisions

The methods formatCell, formatCellRange, formatColumn, formatColumns, formatRow and formatRows all take a format structure as an argument which can contain the following keys and values.

alignment (string): One of the POI horizonal alignment values

bold (boolean)

bottomborder (string): One of the POI Border Styles

bottombordercolor (string): See color for possible values

color (string): The name of a pre-set colour or an RGB triplet, e.g. 255,255,255. NB: Only XLSX files can use exact RGB specified colours. Binary XLS files will use the closest pre-defined colour.

dataformat (string): One of the POI built-in formats

fgcolor (string): See color for possible values

fillpattern (string): One of the POI fill patterns

font (string): name of a valid system font.

fontsize (integer): size in points.

hidden (boolean): (This doesn't appear to work).

indent (integer): (This doesn't appear to work).

italic (boolean)

leftborder (string): One of the POI Border Styles

leftbordercolor (string): See color for possible values

locked (boolean): (This doesn't appear to work).

rightborder (string): One of the POI Border Styles

rightbordercolor (string): See color for possible values

rotation (integer): -90 to 90 for XLS files, or 0 to 180 for XLSX

strikeout (boolean)

topborder (string): One of the POI Border Styles

topbordercolor (string): See color for possible values

textwrap (boolean) whether the text should be wrapped

underline (boolean)

verticalalignment (string): One of the POI vertical alignment values

Clone this wiki locally