Page 1 of 1
Moving the table to the center of the page
Posted: Mon Dec 05, 2022 12:35 pm
by [Stupid]_[User]
Hello everyone!
There are a lot of tables in my document. Most them have different sizes. It's a big problem for me that small tables "sticky" to the left part of the page (for example you can see
Table 3. Fixed in the picture below). Is there any way to move such tables to the center of the page?
oxyforum.PNG
It wold be awesome for me to get a result, similar to figure below (I do it by using
Microsoft Office).
oxyforum_word.PNG
Re: Moving the table to the center of the page
Posted: Mon Dec 05, 2022 1:48 pm
by andrei_pomacu
Hello,
If you are using PDF&CSS Transformation you could easily add new CSS rule which will align your table in the middle of the page.
- Add on your table an outputclass to be easily identified in the CSS file .
- Create a CSS file with this code inside:
Code: Select all
*[class ~="topic/table"][outputclass = "fixed-table-center"]{
margin-left: auto;
margin-right: auto;
}
- For linking the CSS file, you have two options:
- Create a publishing template, create the customization CSS file inside the template folder, and link it to the publishing template descriptor. For assistance, see Publishing Templates.
- Choose an existing publishing template, then edit the scenario and set the full path to the custom CSS file as the value of the args.css parameter. The rules from custom CSS will override the rules from the template CSS files.
Regards,
Andrei
Re: Moving the table to the center of the page
Posted: Mon Dec 12, 2022 2:03 pm
by [Stupid]_[User]
andrei_pomacu wrote: ↑Mon Dec 05, 2022 1:48 pm
Hello,
If you are using PDF&CSS Transformation you could easily add new CSS rule which will align your table in the middle of the page.
- Add on your table an outputclass to be easily identified in the CSS file .
- Create a CSS file with this code inside:
Code: Select all
*[class ~="topic/table"][outputclass = "fixed-table-center"]{
margin-left: auto;
margin-right: auto;
}
- For linking the CSS file, you have two options:
- Create a publishing template, create the customization CSS file inside the template folder, and link it to the publishing template descriptor. For assistance, see Publishing Templates.
- Choose an existing publishing template, then edit the scenario and set the full path to the custom CSS file as the value of the args.css parameter. The rules from custom CSS will override the rules from the template CSS files.
Regards,
Andrei
Hi, Andrei!
It works great! Thanks a lot!