CSS ignored without class selector

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
fsteimke
Posts: 87
Joined: Tue Jan 01, 2013 3:19 pm

CSS ignored without class selector

Post by fsteimke »

I have a simple HTML file with two cells in two columns. I want to set the padding for `td` elements via CSS. This is my HTML:

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Test</title>
        <link rel="stylesheet" href="test.css" />
    </head>
    <body>
        <table>
            <colgroup>
                <col class="a" />
                <col class="b" />
            </colgroup>
            <tr>
                <td class="c"/>
                <td class="c">Column B</td>
            </tr>
        </table>
    </body>
</html>
I can set padding for `td` elements of `@class='c' to 5px with the following CSS code:

Code: Select all

td.c {
    padding: 5px
}
But when i change CSS code so that every `td` Element is selected, it seems to be ignored:

Code: Select all

td {
    padding: 5px
}
leads to following FO snippet with `padding-*=' 1px`

Code: Select all

<fo:table-cell start-indent="0" end-indent="0"
  border-bottom-color="red" border-bottom-style="dashed"
  border-bottom-width="1px" border-left-color="red"
  border-left-style="dashed" border-left-width="1px"
  border-right-color="red" border-right-style="dashed"
  border-right-width="1px" border-top-color="red"
  border-top-style="dashed" border-top-width="1px"
  padding-bottom="1px" padding-left="1px"
  padding-right="1px" padding-top="1px"
  display-align="center">
  <fo:block>Column B</fo:block>
Is it a bug, or do i miss something?
Frank Steimke
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: CSS ignored without class selector

Post by julien_lacour »

Hi Frank,

I tested your HTML test file in <oXygen/> XML Editor 27.0, build 2024121306 using td { padding: 5px }, I did get the correct values in FO:

Code: Select all

<fo:table-cell start-indent="0" end-indent="0"
    padding-bottom="5px" padding-left="5px"
    padding-right="5px" padding-top="5px"
    display-align="center">
    <fo:block>Column B</fo:block>
</fo:table-cell>
Could you indicate which version of Oxygen you are using?

Regards,
Julien
fsteimke
Posts: 87
Joined: Tue Jan 01, 2013 3:19 pm

Re: CSS ignored without class selector

Post by fsteimke »

I had Oxygen 26 when i reported the Issue.

After an update to recent version XML Editor 27.0, build 2024121306 i can confirm that the Issue has been corrected. The resulting FO file shows 5px padding as expected.

Thanks,
Frank Steimke
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: CSS ignored without class selector

Post by julien_lacour »

Hello,

I tested using <oXygen/> XML Editor 26.1, build 2024091606 and cannot reproduce the problem.
But I'm glad the problem is not present anymore on your side.

Regards,
Julien
Post Reply