How to apply space between table rows in XSL-FO?

In my case, I have to provide spaces between two rows of the table up to 0.5 cm. How can I achieve this.

code::

I used:

<fo:table-row space-before="0.5cm" keep-together.within-column="always"> 

but it does not work, but the same attribute that I used in the table

 <fo:table space-before="0.5cm" border="solid 0.1mm black"> 

it works here (if there is space between the two tables) please let me know the solution

+6
source share
2 answers

Kevin's solution works by adding some space between the cell border and the internal content. In some cases, this may be sufficient. But the correct solution (and only one if you have a table with visible borders) is IMHO instead of border-division \ border-spacing :

<fo:table border-collapse="separate" border-separation="3pt">...</fo:table> This will add 3pt space between the borders of adjacent cells in the direction of rows and columns.

There is also a CSS shorthand border-spacing property :

<fo:table border-collapse="separate" border-spacing="5pt 2pt">...</fo:table> This will add 5pt space between the columns and 2pt space between the lines.

Edit: rephrased argument about Kevin's correctness. Added links to the specification. An alternative to border-spacing and an example of how to specify different spaces for rows / columns are added.

+15
source

Use padding for blocks inside table cells.

+4
source

Source: https://habr.com/ru/post/954650/


All Articles