Each part of a table takes its look
from a style of its own family: table, table-column,
table-row and table-cell, holding the matching properties
element. A cell style may also hold paragraph and text properties for the paragraphs
in the cell. This page lists every attribute of the four elements from OpenDocument
1.3 part 3, sections 17.15 to 17.18 and chapter 20.
In ODF a row’s height and a column’s width include the space for borders and padding, so the column widths always add up to the table’s width.
Table properties
style:table-properties may hold a style:background-image.
| Attribute | Values | Meaning |
|---|---|---|
style:width | positive length | The table’s width. Every table must have a fixed width. |
style:rel-width | percent | Width relative to the area the table is in. |
table:align | left, center, right, margins | Horizontal alignment; margins fills the space between the margins (readers that do not support it may treat it as left). Left- and centre-aligned tables ignore the right margin; right- and centre-aligned ones ignore the left margin. |
fo:margin, fo:margin-left, -right, -top, -bottom | length or percent | Space round the table. |
table:border-model | collapsing, separating | collapsing: between two cells with different borders the wider one is drawn, half in each cell; separating: each cell draws its own borders inside itself. |
fo:break-before, fo:break-after | auto, column, page | Break before or after the table. |
fo:keep-with-next | auto, always | Keep with the following paragraph. |
style:may-break-between-rows | true, false | Whether a page break may fall inside the table. |
style:page-number | non-negative integer, auto | Page number of a new page started by the style’s master page. |
fo:background-color | transparent or colour | Background. |
style:shadow | none or an XSL shadow | Shadow behind the table. |
style:writing-mode | as for paragraphs | Order of the cells (left to right or right to left); page takes it from the enclosing area. |
table:display | true, false | Whether the table is shown. |
table:tab-color | colour | Spreadsheets: colour of the sheet’s tab; default the program’s. |
Column properties
| Attribute | Values | Meaning |
|---|---|---|
style:column-width | positive length | Fixed width. |
style:rel-column-width | number followed by * | Relative width: column width = its relative width × available width ÷ sum of all relative widths. |
style:use-optimal-column-width | true, false | Recalculate the width when the content changes. |
fo:break-before, fo:break-after | auto, column, page | Break before or after the column (spreadsheet printing). |
<style:style style:name="Table1.A" style:family="table-column">
<style:table-column-properties style:column-width="5.6cm" style:rel-column-width="3175*"/>
</style:style>
Row properties
style:table-row-properties may hold a style:background-image.
| Attribute | Values | Meaning |
|---|---|---|
style:row-height | positive length | Fixed height. |
style:min-row-height | non-negative length | Minimum height. |
style:use-optimal-row-height | true, false | Recalculate the height when the content changes. |
fo:keep-together | auto, always | Do not split the row across pages. |
fo:break-before, fo:break-after | auto, column, page | Break before or after the row. |
fo:background-color | transparent or colour | Background. |
Cell properties
style:table-cell-properties takes the border, border-line-width,
padding, shadow and background attributes described under
paragraph
formatting, a style:background-image, and:
| Attribute | Values | Meaning |
|---|---|---|
style:vertical-align | top, middle, bottom, automatic | Vertical alignment of the content; automatic leaves it to the program. |
style:text-align-source | fix, value-type | Take horizontal alignment from fo:text-align, or from the value type (strings left, other types right). |
style:direction | ltr, ttb | Characters in the writing direction, or stacked top to bottom without rotating. |
style:writing-mode | as for paragraphs | Layout direction of the cell. |
style:glyph-orientation-vertical | auto, 0, 0deg, 0rad, 0grad | Vertical glyph orientation (SVG §10.7.3); 0 turns it off. ODF 1.1 readers do not know angle units. |
style:rotation-angle | angle | Rotation of the cell content. |
style:rotation-align | none, bottom, top, center | none: rotated text stays inside the cell, borders unchanged; otherwise it may run over other cells, and borders and background are drawn parallel to it, aligned on the named edge. |
fo:wrap-option | wrap, no-wrap | Wrap text in the cell; whether text that does not fit is shown is up to the program. |
style:shrink-to-fit | true, false | Reduce the font size so the content fits. |
style:repeat-content | true, false | Repeat the text to fill the cell (no effect if it has a line break). |
style:print-content | true, false | Print the cell’s content. |
style:cell-protect | none, hidden-and-protected, or a list of protected and formula-hidden | Only if the table is protected. protected: cannot be edited; formula-hidden: a formula is not shown (but can be replaced); both: not editable, formula hidden, result shown; hidden-and-protected: nothing shown, not editable. |
style:decimal-places | non-negative integer | Only in a default style: most decimals shown when the data style says none. |
style:diagonal-tl-br, style:diagonal-bl-tr | border value | Spreadsheets: a diagonal line top-left to bottom-right, or bottom-left to top-right. |
style:diagonal-tl-br-widths, style:diagonal-bl-tr-widths | three positive lengths | Widths of a double diagonal line. |
<style:style style:name="Table1.A1" style:family="table-cell">
<style:table-cell-properties fo:padding="0.097cm" fo:background-color="#dddddd"
style:vertical-align="middle" fo:wrap-option="wrap"/>
</style:style>
Source
OpenDocument Version 1.3, OASIS Standard, 27 April 2021, part 3 (schema), sections 17.15 to 17.18 and the matching attributes in chapter 20 (including Table 21, rotation align values); read in full for this page.