<table>

Description

A tabular based structure containing cells.

Tables have a header (specified via the <head> element) and a body (specified via the <body> element).

Tables are special elements in so far as a translated table has implicit column classes applied to its columns. Unlike HTML and other table designs, there are no column specification elements in a BDML table. Instead, the special CSS .bdml-colX classes (where X is a number from 1 to the number of columns in the table) can be used to style the columns, by applying CSS descendant rules such as the following to the implicit column specification classes:

 #my-table .bdml-col1 { width: 20%; }
 #my-table .bdml-col2 { width: 20%; }
 #my-table .bdml-col3 { width: 30%; }
 #my-table .bdml-col4 { width: 30%; }
		

When the above CSS is applied to a BDML document with a table with four columns and with identity #my-table, each column will be styled with the specified width.

Attributes

No attributes other than standard attributes are defined for <table> elements.

Immediate descendants

Element name Description
<head> The header of the table.
<body> The body of the table.

Immediate ancestors

Element name Relation
<chapter> The chapter element enclosing the table.
<section> The section element enclosing the table.

Example

<document xmlns="http://boradoc.org/1.0">
  <chapter>
    <table>
      <head>
        <cell>header 1</cell>
        <cell>header 2</cell>
      </head>
      <body>
        <row>
          <cell>R1-C1</cell>
          <cell>R1-C2</cell>
        </row>
        <row>
          <cell>R2-C1</cell>
          <cell>R2-C2</cell>
        </row>
      </body>
    </table>
  </chapter>
</document>

The above BDML renders to the following:

header 1 header 2
R1-C1 R1-C2
R2-C1 R2-C2