Pages: 1
Print
Author Topic: Table width(s) issues  (Read 1066 times)
ChrisTMH
Member

Posts: 17


« on: August 16, 2016, 01:33:05 AM »

Hi again,

What has lead me to having this issue is there being, it seems, no way to set the size of a table overall. To get around this, a user specifies the width of the table either by scale or by absolute size, which is then calculated and divided up amongst the columns, with each column width being set, resulting in the width of the table being as expected by the user.

The issue I'm having is that whenever I specify and absolute width, in my case with millimeters, the widths are only changed in the XMetaL view but not in PDF view. I've also tried this using "Book via RenderX" for output, no change.

Any advice on this?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2484



WWW
« Reply #1 on: August 16, 2016, 01:16:01 PM »

The DITA specification uses the OASIS CALS spec for tables (at least that is the only table type in DITA that supports widths in the markup). This table model is very different from HTML, which is what most people are familiar with (if they are familiar with any kind of table model).

Unlike HTML, you cannot directly specify an overall table size with CALS and have the columns expand to fill it. Or you can (using proportional sizes), but if you do then you have no control over the exact size of the table. If you want to control the exact size of the table then you need to use fixed width columns. You can then use the pgwide attribute on the table element itself if you want to change the behaviour of the overall table size:

Quote from: DITA Specification for <table> element
In DITA tables, in place of the @expanse attribute used by other DITA elements, the @pgwide attribute is used in order to conform to the OASIS Exchange Table Model. The @pgwide attribute has a similar semantic (1=page width; 0=resize to galley or column).

If you want a table to be a specific size you set all columns using fixed width units (cm, in, etc) and not * (proportional). If you have one or more columns in a table set using proportional width then it will fill in any remaining space after any fixed width columns have been set.

Note that the deliverable "XMetaL Enhanced PDF via RenderX XEP" does not respect the pgwide attribute, so if you want PDF output with tables that are not full width you will either need to modify it or use another deliverable that outputs PDF.

Table widths or formatting of any kind in XML is tending away from the concept of separating content from style. For the two main table models in use with XML (HTML and CALS) their markup tends to "pollute" the rest of the content (my opinion). Producing different outputs from this kind of markup can be troublesome (or at least extra work) if the widths, or other table settings that are essentially style, are important to you. You may end up needing to produce a duplicate table with slightly different settings for different outputs for DITA, if you produce both PDF and HTML. Conditional text could be used to do that, or you might prefer to alter how the DITA Open Toolkit handles them.

An alternative is to set things up with another attribute (in DITA this might be @outputclass) that tells the DITA OT to lay out the entire table according to a standard set of stylist rules (which might be different for different outputs) but this would also require the DITA OT to be modified to recognize whatever values you choose for that and produce the desired table layout.
« Last Edit: August 16, 2016, 01:17:38 PM by Derek Read » Logged
ChrisTMH
Member

Posts: 17


« Reply #2 on: August 19, 2016, 01:52:39 AM »

The DITA specification uses the OASIS CALS spec for tables (at least that is the only table type in DITA that supports widths in the markup). This table model is very different from HTML, which is what most people are familiar with (if they are familiar with any kind of table model).

Unlike HTML, you cannot directly specify an overall table size with CALS and have the columns expand to fill it. Or you can (using proportional sizes), but if you do then you have no control over the exact size of the table. If you want to control the exact size of the table then you need to use fixed width columns. You can then use the pgwide attribute on the table element itself if you want to change the behaviour of the overall table size:

Quote from: DITA Specification for <table> element
In DITA tables, in place of the @expanse attribute used by other DITA elements, the @pgwide attribute is used in order to conform to the OASIS Exchange Table Model. The @pgwide attribute has a similar semantic (1=page width; 0=resize to galley or column).

If you want a table to be a specific size you set all columns using fixed width units (cm, in, etc) and not * (proportional). If you have one or more columns in a table set using proportional width then it will fill in any remaining space after any fixed width columns have been set.

Note that the deliverable "XMetaL Enhanced PDF via RenderX XEP" does not respect the pgwide attribute, so if you want PDF output with tables that are not full width you will either need to modify it or use another deliverable that outputs PDF.

Table widths or formatting of any kind in XML is tending away from the concept of separating content from style. For the two main table models in use with XML (HTML and CALS) their markup tends to "pollute" the rest of the content (my opinion). Producing different outputs from this kind of markup can be troublesome (or at least extra work) if the widths, or other table settings that are essentially style, are important to you. You may end up needing to produce a duplicate table with slightly different settings for different outputs for DITA, if you produce both PDF and HTML. Conditional text could be used to do that, or you might prefer to alter how the DITA Open Toolkit handles them.

An alternative is to set things up with another attribute (in DITA this might be @outputclass) that tells the DITA OT to lay out the entire table according to a standard set of stylist rules (which might be different for different outputs) but this would also require the DITA OT to be modified to recognize whatever values you choose for that and produce the desired table layout.

Ok, all understood. The issue I have, however, is that if I set the column widths of my table to an absolute value, in my case now 40mm for each, then this is not shown on the PDF, only on the XMetaL view. Why does this happen?

Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2484



WWW
« Reply #3 on: August 22, 2016, 03:49:33 PM »

Which deliverable are you using to produce the PDF?
If you are using "XMetaL Enhanced PDF via RenderX XEP" then...
Quote
Note that the deliverable "XMetaL Enhanced PDF via RenderX XEP" does not respect the pgwide attribute, so if you want PDF output with tables that are not full width you will either need to modify it or use another deliverable that outputs PDF.
Logged
Pages: 1
Print
Jump to: