Jump to content

Right align the last words in a paragraph to the bottom right of a table cell


pengi

Recommended Posts

Hello everybody,

 

I have created a table with fixed cell width and height for each cell. Now I would like to put some text, which end with a number into the cells. I assume the height is good enough for a paragraph of 2 lines only, but the number should always be aligned right at the bottom line. I have tried this CSS:

 

.para      { display:block; margin-left:0px; margin-right:0px;}
.para span { display:block; margin-left:0px; margin-right:0px; float:right; text-align:right;}

 

With this HTML:

<td height='40'><p class="para">Here is the description. <span>135</span></p></td>

 

It works ok, but if the words and the number only spans one single line, the number will be right-aligned at Line 1 instead.

On the other hand, if I change float:right to float:bottom-right, when the words spans 2 lines, the number will be dropped to the right side of Line 3. Is there any way to solve the problem so that the number is always shown on Line 2 and right-aligned?

 

Thanks!

Pengi.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.