Page Wide Table

Post here questions and problems related to editing and publishing DITA content.
SunilCP
Posts: 10
Joined: Wed Jan 04, 2023 8:44 am

Page Wide Table

Post 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?
andrei_pomacu
Posts: 39
Joined: Mon Jul 25, 2022 11:18 am

Re: Page Wide Table

Post 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
SunilCP
Posts: 10
Joined: Wed Jan 04, 2023 8:44 am

Re: Page Wide Table

Post by SunilCP »

Thanks a lot for the solution.
Post Reply