Format

Format provides styling and display options for a cell, but can also be applied to rows, columns, sheets and the complete workbook.

Examples

"emphasize-blue": {
    "italic": true,
    "border": "double",
    "alignH": 2,
    "backgroundColor": {
        "name": "aqua"
    }
}

Implementations

The format element can be used in the following components:

Properties

name type description
dataType string data type of cell

possible values:
string
number
date
blank
timestamp
formula
alignH integer Horizontal alignment of text

possible values:
0 general
1 left
2 center
3 right
4 full
5 justify
6 merge
7 distributed
alignV integer Vertical alignment of text

possible values:
0 Top
1 Center
2 Bottom
3 Justify
4 Distributed
backgroundColor object Contains color as Name, Ref or RGB
Color
foregroundColor object
borderColor object
borderTopColor object
borderBottomColor object
borderRightColor object
borderLeftColor object
borderDiagonalColor object
border string Sets the border style by ID or name.

possible values:
0 None
1 Thin
2 Medium
3 Dashed
4 Dotted
5 Thick
6 Double
7 Hair
8 Medium dashed
9 Dash dot
10 Medium dash dot
11 Dash Dot Dot
12 Medium dash dot dot
13 Slant dash dot
integer
borderTop string
integer
borderRight string
integer
borderBottom string
integer
borderLeft string
integer
borderDiagonal string
integer
borderDiagonalMode string Puts diagonal strokes in a cell.

possible values:
none
up
down
both
fontName string Font face name (e.g. 'Helvetica')
fontSize integer Font Size in pt
fontColor object Contains color as Name, Ref or RGB
Color
fontRef string Name of a Font Definition
italic boolean Toggle for displaying text as italic.
bold boolean Toggle bold font style
underline string Sets the underline style of the font.

possible values:
single
double
acc single
acc double
wrap boolean Toggle whether the cell text is wrapped.
pattern integerBackground Pattern

0 None
1 Solid
2 50% Gray
3 75% Gray
4 25% Gray
5 Horizontal Stripes
6 Vertical Stripes
7 Reverse Diagonal Stripes
8 Diagonal Stripes
9 Diagonal Cross Hatch
9 Thick Diagonal Stripe
11 Thin Horizontal Stripe
12 Thin Vertical Stripe
13 Thin Reverse Diagonal Stripe
14 Thin Diagonal Stripe
15 Thin Horizontal Cross Hatch
16 Thin Diagonal Cross Hatch
17 Gray 12P5
18 Gray 6P25
string
shrinkToFit boolean
formatRef string Reference to a named format.
numberFormat integer individual format options for numbers, dates, currencies, see MBS doumentation
e.g. 14 for the OS date format
numberFormatCustom string custom format options for numbers, dates, currencies..., check www.mbsplugins.eu/XLBookAddCustomNumFormat