-
-
Notifications
You must be signed in to change notification settings - Fork 40
Formatting options
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 - full list of available colours, also available via the getPresetColorNames() method - 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): the number of spaces to indent the text in the cell. For XLS files, the maximum value is 15. (NB: this format may only work in MS Excel.)
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).
quoteprefixed (boolean): Use to force a value to be added as a string (same effect as prefixing the value with a quote character)
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 OR string): Either true/false or one of the following: "none", "single, "double", "single accounting", "double accounting". The "accounting" types simply add a bit more space between the text and the underline in MS Excel.
verticalalignment (string): One of the POI vertical alignment values