• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Learning DITA

Free DITA training

Free DITA training

  • Log in
  • Register
  • Newsletter
  • Profile
  • Privacy
  • Home
  • About
  • Courses
  • News
  • Resources
  • Support the site
  • Contact
  • Recordings

Adding simple tables to a concept topic

Posted on 08.30.15

There are two elements available for creating tables in a concept topic: <simpletable> and <table>.

Use the <simpletable> element whenever you can, especially for short tables. Use the <table> element for larger tables or tables that need more complex formatting.

The elements contained in the <simpletable> element include:

<sthead>

The container element for the header row of a <simpletable> element. The <sthead> element contains the <stentry> element and is optional. There can only be one <sthead> element in a <simpletable> element.

<strow>

The container element for the body rows of a <simpletable> element. The <strow> element contains the <stentry> element. A <simpletable> element can have one or more <strow> elements.

<stentry>

The container element for a single cell in a <simpletable> element. The <stentry> element contains the text of a cell in the <simpletable> element, which should be wrapped in a <p> element according to best practice.

This lesson will cover the basics of using the <simpletable> element.

Figure 1. Example <simpletable> in a visual format

Continue using the file lesson2/l_concept_images_tables_start.dita to add the <simpletable> and <table> elements.

Note:

If you are using a DITA editor, some child elements of the <simpletable> element will automatically be inserted as you work through the examples.

Practice
  1. Inside the <conbody> element after the <fig> element, add a <simpletable> element as shown in the following example:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    <concept id="concept_images_tables">
       <title>Duckling growth and development</title>
      <conbody>
    ...
    </fig>
     <simpletable>
     </simpletable>

       </conbody>
    </concept>
  2. Inside the <simpletable> element, add the <sthead> element as shown in the following example:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    <concept id="concept_images_tables">
       <title>Duckling growth and development</title>
     <conbody>
    ...
    <simpletable>
    <sthead>
    </sthead>

    </simpletable>
       </conbody>
    </concept>
    The <sthead> element sets up the header row of the <simpletable> element.
  3. Inside the <sthead> element, add two <stentry> elements and add content to them as shown in the following example:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    <concept id="concept_images_tables">
       <title>Duckling growth and development</title>
      <conbody>
    ...
    <sthead>
    <stentry><p>Age</p></stentry>
    <stentry><p>Milestone</p></stentry>

    </sthead>
    ...
       </conbody>
    </concept>
    The <stentry> element represents a single cell. The number of <stentry> elements inside the <sthead> element will determine how many columns will be in your <simpletable> element.
    Each <stentry> element you added follows the best practice of wrapping a <p> element around the text.
  4. After the <sthead> element, add the <strow> element as shown in the following example:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    <concept id="concept_images_tables">
       <title>Duckling growth and development</title>
       <conbody>
    ...
    </sthead>
    <strow>
    </strow>

    ...
       </conbody>
    </concept>
    The <strow> element sets up each body row following the header row of the <simpletable> element.
  5. Inside the <strow> element, add two <stentry> elements and add content to them as shown in the following example:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    <concept id="concept_images_tables">
       <title>Duckling growth and development</title>
      <conbody>
    ...
    <strow>
    <stentry><p>7 weeks</p></stentry>
    <stentry><p>Attempt flight for the first time</p></stentry>

    </strow>
    ...
       </conbody>
    </concept>

    Every <strow> element and the <sthead> element should contain the same number of <stentry> elements.

  6. After the first <strow> element, add two more rows to the <simpletable> element and add content to them as shown in the following example:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    <concept id="concept_images_tables">
       <title>Duckling growth and development</title>
     <conbody>
    ...
    </strow>
    <strow>
    <stentry><p>12-14 weeks</p></stentry>
    <stentry><p>Reach adult body weight</p></stentry>
    </strow>
    <strow>
    <stentry><p>1 year</p></stentry>
    <stentry><p>Capable of reproduction</p></stentry>
    </strow>

    ...
       </conbody>
    </concept>
    You can add one or more <strow> elements to a <simpletable> element.
Contributors
  • Gretyl Kinsey, Scriptorium

sidebar

Blog Sidebar

  • Scriptorium logo
    Maximize the value of your content. Read more.
  • Scriptorium logo
    Already in DITA and need support? Contact us.
RSSTwitter

Want to add content? Join the ditatraining GitHub repository.

  • Home
  • Sponsor
  • News
  • Contact
  • Privacy
  • Cookie Policy

Maintained by Scriptorium Publishing

Logo and site presentation © 2015-2023 Scriptorium Publishing. Content based on the open-source DITA training project.

Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage vendors Read more about these purposes
View preferences
{title} {title} {title}
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage vendors Read more about these purposes
View preferences
{title} {title} {title}