DITA: Tables
To insert a table, either click the Table button in the Author view and select your options, or in the Text view, type t, wait for the "table" prompt, and then press Enter. In the cols="" field, type the number of columns you want. Put your cursor right after tgroup
element and type <
and select thead at the prompt, then press Enter.
The table code looks like this:
The title ends up being set as the caption on the top of the table. You can actually set the column widths using the table properties. Switch to the Author mode to view your table. Grab the middle column divider and drag it a bit. You'll be prompted whether you want proportional or fixed columns. Choose proportional, since it will render better on different devices. Now drag the middle column divider to the width appropriate for your content.
Once you set the column widths, switch back to the text view to see the values assigned to the
colspec
element that was added to your table.
Here, the first second column will be twice as wide as the first column.
About Tom Johnson
I'm an API technical writer based in the Seattle area. On this blog, I write about topics related to technical writing and communication — such as software documentation, API documentation, AI, information architecture, content strategy, writing processes, plain language, tech comm careers, and more. Check out my API documentation course if you're looking for more info about documenting APIs. Or see my posts on AI and AI course section for more on the latest in AI and tech comm.
If you're a technical writer and want to keep on top of the latest trends in the tech comm, be sure to subscribe to email updates below. You can also learn more about me or contact me. Finally, note that the opinions I express on my blog are my own points of view, not that of my employer.