Creation of tables for imported content

Article Being Developed

For clarification of anything below, please contact Liquid State Support.

Simple tables

Tables defined in an XML import must be have a value element containing HTML in a CDATA section.

Example of a simple Table Field element
<table field_type="example-field-type">
   <value format="html"><![CDATA[
      <table>
            <caption>Table caption text</caption>
            <thead>
                <tr>
                    <th>Column 1</th>
                    <th>Column 2</th>
                    <th>Column 3</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Row 1 Cell 1</td>
                    <td>Row 1 Cell 2</td>
                    <td>Row 1 Cell 3</td>
                </tr>
                <tr>
                    <td>Row 2 Cell 1</td>
                    <td>Row 2 Cell 2</td>
                    <td>Row 2 Cell 3</td>
                </tr>
            </tbody>
   </table>]]>
   </value>
</table>

Basic rules to go by

  • Use a real caption element for the table caption. CSS styling can take care of positioning it above or below the table.
  • Use thead and tbody elements.
  • Use th elements for cell which represent a header for a column or a row.

Things to avoid

  • Never specify a width for any cell, including header cells (th)
  • Never specify cellpadding

Complex tables

Cells spanning multiple rows or columns can be used but require a bit of care.

Row spans

One rule must be follwed to make CSS styling more flexible:

The first cell in a row adjacent to another row with a cell spanning multiple rows must contain the scope="row" attribute.

It's gets a whole lot clearer with an example:

Example of a simple Table Field element
<table field_type="example-field-type">
   <value format="html"><![CDATA[
      <table>
            <caption>Table caption text</caption>
            <thead>
                <tr>
                    <th>Column 1</th>
                    <th>Column 2</th>
                    <th>Column 3</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td rowspan="3">Row 1 Cell 1</td>
                </tr>
                <tr>
                    <td scope="row">Row 2 Cell 2</td>
                    <td>Row 2 Cell 3</td>
                </tr>
            </tbody>
   </table>]]>
   </value>
</table>

Column spans

Article Being Developed

Column span documentation is incomplete. If you require information on column spans in imported content, please contact Liquid State Support.


Unless otherwise indicated in the Overview page of this WIKI the information contained within this space is Classified according to the /wiki/spaces/ISMS/pages/739344530 as

INTERNAL