Simpletable css selector and table caption

Post here questions and problems related to editing and publishing DITA content.
MariPe
Posts: 15
Joined: Wed Mar 06, 2019 4:35 pm

Simpletable css selector and table caption

Post by MariPe »

Hi there,

I have two table issues, I just cant solve by myself. I'm using Oxygen 20.1 with DITA and customized PDF (CSS/HTML5) and Webhelp responsive publishing.
First issue is that the simple table doesn't have horizontal borders in the tbody. Every selector I tried, worked in the <filename>merged.html but not in the actual PDF. Somewhere there is a css definition that still overrides my definitions and it's driving me mad ;-)

The other issue is that I want to place table captions below a table and as far as I can see, I need to do a XSLT extension, right? Can you give me a clue where the XSL Template is that I need to override?

Thanks!
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: Simpletable css selector and table caption

Post by Costin »

Hi,

Have you tried using the !important declaration on your rules?
As you specified that they were present in the merged.html file, it could be possible that other rules overwrite the ones you tried to use, but if you use !important on them, they should prevail.

Regarding your 2nd question, are you referring to the WebHelp Responsive output?

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
MariPe
Posts: 15
Joined: Wed Mar 06, 2019 4:35 pm

Re: Simpletable css selector and table caption

Post by MariPe »

HI Costin,
thanks for your suggestion. But the !important does not make any difference :-/

This is the CSS I use for the simpletable:

Code: Select all

.simpletable>thead>tr>th, 
.simpletable>thead>tr>td,
.simpletable>tfoot>tr>th,
.simpletable>tfoot>tr>td,
.simpletable>tbody>tr>th,
.simpletable>tbody>tr>td,
.simpletable>caption+thead>tr:first-child>td,
.simpletable>caption+thead>tr:first-child>th,
.simpletable>colgroup+thead>tr:first-child>td,
.simpletable>colgroup+thead>tr:first-child>th,
.simpletable>thead:first-child>tr:first-child>td,
.simpletable>thead:first-child>tr:first-child>th {
border: 1px solid red ;
}
In the merged.html it affects all the table cell but in the final PDF only the header row has a red table cell border, the rest of the border lines is black and also the horizontal lines are still missing. There is some stronger rule somewhere because the example.style.xml always has css:border-bottom-width="0pt" or css:border-top-width="0pt" for the tbody table cells no matter what I try out. And I really have no idea where to investigate further....

The 2nd question referred to WebHelp and I already solved that myself with an XSL extension overriding the templates in Oxygen XML Editor/frameworks/dita/DITA-OT2.x/plugins/org.dita.html5/xsl/tables.xsl :)
Last edited by MariPe on Tue Mar 26, 2019 6:24 pm, edited 1 time in total.
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: Simpletable css selector and table caption

Post by Costin »

Hi,

I tested using a customization CSS file that contains only your rule (clear of any other rulesets) and the selectors from your rule seems to have the correct effect, as you can see from the attached screenshot.
Therefore, you should continue debugging your customization CSS, as most probably the problem resides in the other customization you have in it.

As a suggestion, you could also try using the class selector instead and see if it makes any difference.
For example: ".simpletable>thead>tr>th" could translate in "*[class~="topic/sthead"]" , ".simpletable>thead>tr>td" in "*[class~="topic/stentry"]", etc.

Image

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
MariPe
Posts: 15
Joined: Wed Mar 06, 2019 4:35 pm

Re: Simpletable css selector and table caption

Post by MariPe »

Hi Costin,
thanks for your suggestions. I tried now with a new template that only contains the CSS I posted before. the class selector has the same result.
I found out that if I use a simpletable in the dita file the CSS works.But if I use properties which are transformed into a table with simpletable attribute then it doesn't work.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="table_test">
<title>Table_test</title>
<shortdesc></shortdesc>
<refbody> <simpletable><sthead><stentry>1</stentry>
<stentry>2</stentry>
</sthead>
<strow><stentry>a</stentry>
<stentry>b</stentry></strow>
</simpletable>
<section>
<title>Example</title>
<p>sdvfjdsfv</p>
</section>
<properties>
<prophead>
<proptypehd>Attribute</proptypehd>
<propvaluehd>Value</propvaluehd>
<propdeschd>Document type</propdeschd>
</prophead>
<property >
<proptype>Data type</proptype>
<propvalue>Dataset</propvalue>
<propdesc>ABC</propdesc>
</property>
<property >
<proptype>wfwfr</proptype>
<propvalue >Testhjsbd</propvalue>
<propdesc>dfkjgbdkjrfg</propdesc>
</property>
<property >
<proptype>wsferfg</proptype>
<propvalue>kolöhuilactor</propvalue>
<propdesc>ghjnfdthjts</propdesc>
</property>
</properties>

</refbody>
</reference>
This topic transforms into the first table having red border and the second having only a red header borders and still missing the horizontal borders.
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: Simpletable css selector and table caption

Post by Costin »

Hi,

Thanks for the feedback!

I confirm there was a bug that affected that specific situation. The roperties which are transformed into a table with simpletable attribute generate a <simpletable> element in the output .fo file, as opposed to a <table> element and the simpletable was not correctly styled.
However, our development team already implemented an improvement in our internal development stream and it will be included in the next release.

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