user1178399
user1178399

Reputation: 1118

How to draw horizontal line in fo-block?

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!

Upvotes: 7

Views: 20309

Answers (2)

yanckst
yanckst

Reputation: 446

You can play with the border-bottom-width and the border-bottom-style.

I changed the margin-top to match your example.

<fo:block 
  border-bottom-width="2pt" 
  border-bottom-style="solid" 
  border-bottom-color="black" 
  font-weight="bold" 
  text-align="center">
    United Nations Organisation 
</fo:block>            
<fo:block text-align="center" font-size="8pt" margin-top="1mm">
  (organisation)
</fo:block>        
<fo:block border-bottom-width="2pt" border-bottom-style="solid"margin-top="7mm">
</fo:block>
<fo:block text-align="center" font-size="8pt" margin-top="1mm">
  (department)
</fo:block>

Hope this helps.

Upvotes: 2

Meiko Rachimow
Meiko Rachimow

Reputation: 4724

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>

Upvotes: 14

Related Questions