Page 1 of 1

Page Wide Table

Posted: Thu Feb 09, 2023 9:50 am
by SunilCP
Hello All,

Using a CSS based transformation for PDF generation.

Code: Select all

/*  Table is aligned 3 cm from margin */
*[class~="topic/table"] {
    margin-left:3cm;
    overflow-wrap: break-word; 
}
/*  Table is set to full margin of the page */
*[class~="topic/table"][outputclass="pgwide"] {
    margin-left:0;
    overflow-wrap: break-word;    
}
Used this to generate 2 different tables, one for normal and another for page wide. This works fine if <table> is standalone element.

But, this is not working when tables are nested within <ul> , <info> or other elements.

How to override the Parent element margin settings and make these tables page wide for any instances?

Any thoughts on this?

Re: Page Wide Table

Posted: Thu Feb 09, 2023 1:02 pm
by andrei_pomacu
Hi,
In your custom css for wide tables you could use negative values in order to bleed towards their parents indentation.
Let's say that you have 2 unordered lists

Code: Select all

<ul>
   <li>
     <ul>
       <li>
         <table outputclass="pgwide">
           <tgroup cols="">
             <tbody>
               <row>
                 <entry></entry>
               </row>
             </tbody>
           </tgroup>
         </table>
       </li>
     </ul>
   </li>
</ul>
and you want the table to be in the line with the first list. You could use margin-left:-value px;
So, you could try different negative values for margin left:

Code: Select all

*[class~="topic/table"][outputclass="pgwide"] {
    margin-left:-40px;
    overflow-wrap: break-word;
}
Regards,
Andrei

Re: Page Wide Table

Posted: Thu Feb 16, 2023 9:23 am
by SunilCP
Thanks a lot for the solution.