createTableStyle

createTableStyle

BASIC / ADVANCED / PREMIUM

Creates a new Word table style.

Description
public void createTableStyle(String name, OptionsTableStyle options)

This method allows the generation of custom table styles that may be later used in combination with, for example, the addTable method.

Parameters

name

A string with the name of the Word style that you are creating.

options

Option Type Description
border String Border type: none, single, double, dashed, threeDEngrave, threeDEmboss, outset, inset... This value can be overridden for each side with the use 'borderTop', 'borderRight', 'borderBottom' and 'borderLeft' properties.
borderColor String Hexadecimal color value: 'FF0000', '000000'... This value can be overridden for each side with the use of 'borderTopColor', 'borderRightColor', 'borderBottomColor' and 'borderLeftColor' properties.
borderSpacing Integer Border spacing in points. This value can be overridden for each side with the use of 'borderTopSpacing', 'borderRightSpacing', 'borderBottomSpacing' and 'borderLeftSpacing' properties.
borderWidth Integer Border size in eigths of a point. This value can be overridden for each side with the use of 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth' and 'borderLeftWidth' properties.
cellMargin Integer The values are given in twentieths of a point.
hidden Boolean Hide style from user interface.
indent Integer Table indentation. The value is given in twentieths of a point.
locked Boolean
pPrStyles OptionsParagraphStyle Paragraph styles to be applied.
rPrStyles OptionsCharacterStyle Character styles to be applied.
semiHidden Boolean Hide style from main user interface.
tableStyle string Id of the style this table style is based on (it may be retrieved with the parseStyles method).
tblStyleColBandSize Boolean Column banded style.
tblStyleRowBandSize Boolean Row banded style.
unhideWhenUsed Boolean Remove semi-hidden property when style is used.
band1HorzStyle OptionsTableStylePr Set odd rows styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
band1VertStyle OptionsTableStylePr Sets odd cols styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
band2HorzStyle OptionsTableStylePr Sets even rows styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
band2VertStyle OptionsTableStylePr Sets even cols styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
firstColStyle OptionsTableStylePr Sets first column styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
firstRowStyle OptionsTableStylePr Sets first row styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
lastColStyle OptionsTableStylePr Sets last col styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
lastRowStyle OptionsTableStylePr Sets last row styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
neCellStyle OptionsTableStylePr Sets top right styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
nwCellStyle OptionsTableStylePr Sets top left styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
seCellStyle OptionsTableStylePr Sets bottom right styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
swCellStyle OptionsTableStylePr Sets bottom left styles using border, borderColor, borderSpacing, borderWidth, backgroundColor, vAlign, rPrStyles, pPrStyles properties.
Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like: