Use the <table> element when you need to create a larger or more complex table than you can with the <simpletable> element. If you need a caption for your table, or more than one header row, use the <table> element.
The elements contained in the <table> element include:
<title> | The container element for the text of a <table> element’s title or caption. A <table> element can only contain one <title> element. |
<tgroup> | The container element for the main content of a <table> element. The <tgroup> element contains the <colspec>, <thead>, and <tbody> elements. A <table> element can contain one or more <tgroup> elements. |
<colspec> | The element that provides information about the columns in a <table> element. The column specifications are defined using the colname (the name of the column), colnum (the order in which the column appears), and colwidth (the relative width of the column) attributes. |
<thead> | The container element for the header in a <table> element. The <thead> element can contain one or more <row> elements and is optional. |
<tbody> | The container element for the body rows in a <table> element. The <tbody> element can contain one or more <row> elements. |
<row> | The container element for a row of cells in a <table> element. The <row> element contains one or more <entry> elements. |
<entry> | The container element for a single cell in a <table> element. The <entry> element contains the text of a cell in the <table> element, which should be wrapped in a <p> element according to best practice. |
This lesson will cover the basics of using the <table> element. To highlight the differences between the <table> and <simpletable> elements, you will be using the same sample content for your <table> exercise as you used for your <simpletable> exercise.
Continue using the file lesson2/l_concept_images_tables_start.dita to add the <table> element.
Note:
If you are using a DITA editor, some child elements of the <table> element will automatically be inserted as you work through the examples.
Video: Creating a table in DITA
Note:
This video shows an alternative way to create a table in DITA using the oXygen XML Editor table wizard. The exercises show you how to create a table using DITA code.