Controlling Table Widths

Tables will typically fill the available text column width, but there are options if you need specific control over table widths.

If you are using the default DITA-FMx structure applications, all tables, regardless of their type, are set to use proportional widths. This means that the table will expand to fill the width of the current text column and all cells within the table will proportionally fill the table based on the widths you assign.

If you want to be able to specify absolute widths for tables, you need to comment out or delete the writer use proportional widths rule in the read/write rules files (topic_1.2.rules.txt and book_1.2.rules.txt). After commenting this line out it will look like the following:

/* writer use proportional widths; */
Note: This setting affects all tables of all types that use the structure application associated with the rule file. You cannot have some tables that are proportional and some that are absolute.

You will also need to disable the Force Tables Wide option in the Authoring Options dialog.

If you’d like a specific table to fill the width of the text frame (overriding the margins or indents), set the table element’s pgwide attribute to 1. This attribute is only available for tables that inherit from the base table element.

An alternate option for defining table widths that vary is through the use of the Preserve Table Widths option in the Authoring Options dialog. This should be used with Force Tables Wide enabled, and will preserve the width of tables to the nearest 5%. A relative table width value is stored in the table’s pgwide attribute (this value is updated on file save).

Use the Preserve Table Widths option only if the “writer use proportional widths” rule is enabled, if disabled, this feature is not needed. Because of the 5% adjustment on save, column widths will not remain exactly as set (they will be close though).

Important: If you’re using the Preserve Table Widths option, problems can occur if the text flow width in the Topic and Book templates are not the same, because the table width is preserved as a percentage of the text flow width. The default DITA-FMx Topic and Book templates do not have matching width text flows. Edit the Reference pages in Topic template to set the text flow width to match that of the Book.