Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical alignment of text in a table cell

Tags:

I would like to align the text to bottom in the second cell. The first cell extends to 2 lines, because of insufficent width and that's OK But the text in the second cell is only one line and shows up at the top of the cell. How can I align it to bottom?

I tried vertical-align="bottom" text-align="bottom" text-align="end" on row , cell and block levels.. Any of them worked?!?

<fo:table font="normal 10 pt Arial, sans-serif" width="100%"> <fo:table-column column-width="40mm"/> <fo:table-column column-width="130mm"/> <fo:table-body> <fo:table-row>   <fo:table-cell padding-before="3pt" padding-after="3pt">      <fo:block font-weight="bold">Pricing Rate in % p.a. / "Pensionssatz in % p.a.":</fo:block>   </fo:table-cell>   <fo:table-cell padding-before="3pt" padding-after="3pt">     <fo:block>       **This text I want to be aligned to bottom (in the second line)**       </fo:block>    </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> 
like image 913
AbsoleteMe Avatar asked Jul 29 '11 14:07

AbsoleteMe


People also ask

How do I align text vertically in a table-cell in Word?

1 Select the text you want to center between the top and bottom margins. 2 On the Page Layout tab, click the Page Setup Dialog Box Launcher. 3 Select the Layout tab. 4 In the Vertical alignment box, click Center 5 In the Apply to box, click Selected text, and then click OK.

Which attribute is used for vertical alignment of text in cell of a table?

The HTML <td> valign Attribute is used to specify the vertical alignment of text content in a cell.

What is vertical alignment of text?

Vertical alignment determines the position of the text within a section of a document relative to the top and bottom margins, and is often used to create a cover page.

Which alignment aligns the text to the vertical middle of the cell?

The vertical-align CSS property sets vertical alignment of an inline, inline-block or table-cell box.


2 Answers

Use display-align="after" on the table cell:

<fo:table-cell padding-before="3pt" padding-after="3pt" display-align="after">  <fo:block>   **This text I want to be aligned to bottom (in the second line)**  </fo:block>  </fo:table-cell> 
like image 92
mzjn Avatar answered Oct 11 '22 16:10

mzjn


Just in case someone found this issue:

If you have an image and text above you don't want to align after but before:

<fo:table-cell display-align="before"> <!-- Your image & text separated in blocks --> <fo:table-cell> 
like image 38
loonix Avatar answered Oct 11 '22 15:10

loonix