19.14. Fonts and layout

Output appearance is controlled with a combination of CSS style and tag attributes. CSS style attributes flow from parent to child, and let you use one tag to apply all attributes defined for that tag in the styleClass and style sheets.
If you have format masks or fonts that use special characters, such as spaces and semicolons, you can escape the CSS string with '' characters such as xls-format-mask:'$;$'.

19.14.1. Stylesheet links

External stylesheets are referenced with the e:link tag. They are placed within the document as if they are children of the workbook tag.
<e:link>
Attributes
  • URL — The URL of the stylesheet.
Child elements
  • none
Facets
  • none
 
<e:workbook> 
  <e:link URL="/css/excel.css"/> 
</e:workbook>           
This references a stylesheet located at /css/excel.css.

19.14.2. Fonts

This group of XLS-CSS attributes define a font and its attributes.
xls-font-family
The name of the font. Make sure the font you enter here is supported by your system.
xls-font-size
A plain number value denoting the font size.
xls-font-color
The color of the font.
xls-font-bold
A Boolean determining whether the font is bold. Valid values are true and false.
xls-font-italic
A Boolean determining whether the font is italicized. Valid values are true and false.
xls-font-script-style
The script style of the font.
xls-font-underline-style
The underline style of the font.
xls-font-struck-out
A Boolean determining whether the font is struck-through. Valid values are true and false.
xls-font
A shorthand notation for setting all values associated with font. Place the font name last. (If you wish to use a font with spaces in its name, use tick marks to surround the font. For example, 'Times New Roman'.) Here, defined italicized, bold, or struck-through text with italic, bold, or struckout.
For example: style="xls-font: red bold italic 22 Verdana"

19.14.3. Borders

This group of XLS-CSS attributes defines the borders of the cell.
xls-border-left-color
The border color of the left edge of the cell.
xls-border-left-line-style
The border line style of the left edge of the cell.
xls-border-left
A shorthand notation for setting the line style and color of the left edge of the cell. Use like so: style="xls-border-left: thick red"
xls-border-top-color
The border color of the top edge of the cell.
xls-border-top-line-style
The border line style of the top edge of the cell.
xls-border-top
A shorthand notation for setting the line style and color of the top edge of the cell. Use like so: style="xls-border-top: red thick"
xls-border-right-color
The border color of the right edge of the cell.
xls-border-right-line-style
The border line style of the right edge of the cell.
xls-border-right
A shorthand notation for setting the line style and color of the right edge of the cell. Use like so: style="xls-border-right: thick red"
xls-border-bottom-color
The border color of the bottom edge of the cell.
xls-border-bottom-line-style
The border line style of the bottom edge of the cell.
xls-border-bottom
A shorthand notation for setting the line style and color of the bottom edge of the cell. Use like so: style="xls-border-bottom: thick red"
xls-border
A shorthand notation for setting the line style and color for all edges of the cell. Use like so: style="xls-border: thick red"

19.14.4. Background

This group of XLS-CSS attributes defines the background of the cell.
xls-background-color
The color of the background.
xls-background-pattern
The pattern of the background.
xls-background
A shorthand for setting the background color and pattern.

19.14.5. Column settings

This group of XLS-CSS attributes defines column properties.
xls-column-width
The width of a column. We recommend beginning with values of approximately 5000, and adjusting as required. Used by the e:column in XHTML mode.
xls-column-widths
The width of each column, respectively. We recommend beginning with values of approximately 5000, and adjusting as required. Used by the excel exporter, and placed in the datatable style attribute. Use numerical values, or * to bypass a column.
For example: style="xls-column-widths: 5000, 5000, *, 10000"
xls-column-autosize
Determines whether the column should be autosized. Valid values are true and false.
xls-column-hidden
Determines whether the column is hidden. Valid values are true and false.
xls-column-export
Determines whether the column is shown in export. Valid values are true and false. Defaults to true.

19.14.6. Cell settings

This group of XLS-CSS attributes defines the cell properties.
xls-alignment
The alignment of the cell value.
xls-force-type
A string value determining the forced type of data in the cell. Valid values are general, number, text, date, formula, and bool. The type is automatically detected so there is rarely any use for this attribute.
xls-format-mask
The format mask of the cell. (See Section 19.6.2, “Format masks”.)
xls-indentation
A number value determining the indentation of the cell's contents.
xls-locked
Determines whether a cell is locked. Used with workbook level locked. Valid values are true or false.
xls-orientation
The orientation of the cell value.
xls-vertical-alignment
The vertical alignment of the cell value.
xls-shrink-to-fit
Determines whether cell values shrink to fit. Valid values are true and false.
xls-wrap
Determines whether the cell wraps new lines. Valid values are true and false.

19.14.7. The datatable exporter

The datatable exporter uses the same XLS-CSS attributes as the XHTML document, with the exception that column widths are defined with the xls-column-widths attribute on the datatable (since the UIColumn doesn't support the style or styleClass attributes).

19.14.8. Limitations

There are some known limitations to CSS support in the current version of Seam.
  • When using .xhtml documents, stylesheets must be referenced through the <e:link> tag.
  • When using the datatable exporter, CSS must be entered through style-attributes — external stylesheets are not supported.