How to draw horizontal line in fo-block?

user1178399 picture user1178399 · Nov 15, 2013 · Viewed 16.3k times · Source

i need to implement next layout:

enter image description here

here's my code:

<fo:block text-align="center">United Nations Organisation</fo:block>                
<fo:block border-top-style="solid" text-align="center">(organisation)</fo:block>        
<fo:block border-top-style="solid" text-align="center">(department)</fo:block>

but in fact the 2nd horizontal line is not drawn. how can i achieve that? what am i doing wrong?

Thanks in advance!

Answer

Meiko Rachimow picture Meiko Rachimow · Apr 6, 2016

You can use fo:leader

<fo:block text-align="center">United Nations Organisation </fo:block>   
<fo:leader leader-pattern="rule" leader-length="100%" rule-style="solid" rule-thickness="2pt"/>             
<fo:block text-align="center" font-size="8pt" margin-top="1mm">(organisation)</fo:block>        
<fo:leader leader-pattern="rule" leader-length="100%" rule-style="solid" rule-thickness="2pt"/>
<fo:block text-align="center" font-size="8pt" margin-top="1mm">(department)</fo:block>