A table consists of rows and cells and is structured much like an HTML table. It is defined with the <w:tbl> element.
Note: When two adjacent tables having the same style are present together without any intervening <w:p> elements, the tables are treated as a single table.
The <w:tbl> element can contain a whole host of elements, mostly related to tracking revisions and adding custom XML. The core elements are shown below.
|tblGrid||Specifies the columns for the table. See Table Table Columns.
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.49.
|tblPr||Specifies the table-wide properties for the table. These properties can be overridden by individual table level exception, row, and cell-level properties. See Table Table properties.
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.60.
|tr||Specifies a table row. See Table Table Row.
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.79.
A table in the ODF format is specified with <table:table> element. A table consists of rows and columns. Rows are divided into cells, and columns are implied by taking all cells with the same position within the rows. A table can appear within a <office:text>, within a section, within a table cell, a header, or a footer, among others.
The most commonly used attributes are below.
Specifies a unique name.
Specifies a table style for the table.
Specifies a unique ID and is standardized by the W3C (xml-id).
Specifies whether the table is protected so the user cannot edit it. Values are true and false.
The most commonly used elements are below.
|<table:table-column>||Specifies properties for one or more adjacent columns.|
|<table:table-column-group>||Groups adjacent columns|
|<table:table-columns>||Contains groups of <table:table-column> elements that don't repeat when a table spans pages.|
|<table:table-header-columns>||Represents column headers.|
|<table:table-header-rows>||Represents row headers.|
|<table:table-row>||Represents a row.|
|<table:table-row-group>||Groups adjacent rows that do not appear as table headers.|
|<table:table-rows>||Contains groups of <table:table-row> elements that don't repeat when a table spans pages.|
|<table:title>||Specifies a title for the table.|