How are data cells defined in DITA table rows?

Cells in table rows are defined using the <entry> element. The <entry> element is used to create individual cells within a row, and it can contain various types of content, such as text, images, or other elements. The <entry> element may include attributes like colname to specify the column to which the cell belongs. This attribute helps in aligning cells with the corresponding columns and is particularly useful for styling and presentation.


        <table>
          <title>Product Comparison</title>
          <tgroup cols="3">
            <colspec colname="col1" colnum="1" colwidth="20%"/>
            <colspec colname="col2" colnum="2" colwidth="30%"/>
            <colspec colname="col3" colnum="3" colwidth="50%"/>
            <thead>
              <row>
                <entry colname="col1">Product</entry>
                <entry colname="col2">Features</entry>
                <entry colname="col3">Price</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>Product A</entry>
                <entry>Feature set A</entry>
                <entry>$100</entry>
              </row>
              <row>
                <entry>Product B</entry>
                <entry>Feature set B</entry>
                <entry>$120</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
    

In this example:

  • The <entry> elements in the <row> define the cells in the table. Each <entry> contains text that corresponds to the content of the cell.
  • The colname attribute in each <entry> specifies the column to which the cell belongs, allowing proper alignment of content within columns.