change the table backgroud

Having trouble installing Oxygen? Got a bug to report? Post it all here.
hedyhan
Posts: 21
Joined: Tue Mar 27, 2018 3:46 pm

change the table backgroud

Post by hedyhan »

I want to change the table (in the first column, and in the second, third ... row) background in the specified topic. How I do?
Costin
Posts: 846
Joined: Mon Dec 05, 2011 6:04 pm

Re: change the table backgroud

Post by Costin »

Hi hedyhan,

We need more detailed information in order to help you with accurate suggestions.
It is not clear:
- what type of table do you need to edit (is it a CALS table?) an d in what document type is the table? Is it a DITA document (as you mentioned "topic"), or something different?
- where do you need the changes to be reflected? In oXygen in the Author mode, or in the published output?
- if you need the change to persist in the output, which specific output type are you publishing to (WebHelp/WebHelp Responsive/PDF2/PDF WYSIWYG/etc.)?

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
hedyhan
Posts: 21
Joined: Tue Mar 27, 2018 3:46 pm

Re: change the table backgroud

Post by hedyhan »

- what type of table do you need to edit (is it a CALS table?) an d in what document type is the table? Is it a DITA document (as you mentioned "topic"), or something different?
- where do you need the changes to be reflected? In oXygen in the Author mode, or in the published output?
- if you need the change to persist in the output, which specific output type are you publishing to (WebHelp/WebHelp Responsive/PDF2/PDF WYSIWYG/etc.)?
- It is a DITA document and a colspec table.
- in the published output.
- PDF
hedyhan
Posts: 21
Joined: Tue Mar 27, 2018 3:46 pm

Re: change the table backgroud

Post by hedyhan »

Hi

Can anyone giver me some advice?
Costin
Posts: 846
Joined: Mon Dec 05, 2011 6:04 pm

Re: change the table backgroud

Post by Costin »

Hi hedyhan,

Most probably you could achieve this by modifying the XSL stylesheet from the DITA OT, that controls tables generation in the output.
The specific XSL file is named "tables.xsl" and can be found in Oxygen_installation_dir\frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\xsl\fo
In case you need to customize only how a/some specific table(s) will appear in the output, you should set an @outputclass attribute on the specific table(s) that you want to customize, prior to any customizing. You could then apply the XSL customization only for the tables that have that specific outputclass.

For more information, take a look at Radu's post on this Forum topic as it seems the user needed to achieve a task similar to yours (changing the background color for the 1st column in a table).

Going further, you could customize the PDF output by creating either a customization folder, or a custom plugin.
If you create a customization folder, you could then have a duplicate of the tables.xsl stylesheet as a starting point, so you could overwrite the default templates with your own, developed in order to achieve the expected results.
However, as we only develop oXygen software, but do not specialize in DITA or provide consultancy services, this would involve strong XSLT knowledge on your part.

You should also look over this interesting blog post that Radu created on our blog, as it could help you with understanding how custmizing the PDF output works for tables.

Last but not least, in case you consider using CSS instead of XSLT would make the job easier for you, you could give a try to the DITA Map PDF WYSIWYG transformation, in which you could use your own custom .css file containing the rules to display the tables in a way you find convenient.
More details here.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Post Reply