Solved: Vertical alignment of text that is right-aligned - not working??

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

JiminSA

Jim
Thread Starter
Joined
Dec 15, 2011
Messages
3,406
I have a CMS which I am using to develop an in-house accounting system. But have encountered a small problem with alignment... If I use the following in-line styling, the vertical alignment seems to default to bottom:confused:
Code:
<p style=\"text-align:right; vertical-align:text-top;\">" . $row["amount"] . "</p>"
this piece of code is included in an array submitted to the CMS via php, hence the escape characters.
The rendered mis-alignment can be seen in the attached thumbnail. Ideas anyone?
 

Attachments

colinsp

Colin
Joined
Sep 5, 2007
Messages
2,325
Jim

It doesn't work like that. Rather than go into detail here (I am lazy when it comes to typing) see this.
 

JiminSA

Jim
Thread Starter
Joined
Dec 15, 2011
Messages
3,406
Yes Colin, I checked out that link when I was trying to sort this anomaly out, but I can't see the wood for the trees... I'm a bit doff when it comes to tables and alignment etc., but it appears to me that you can't set a vertical alignment and a horizontal at the same time, at least not the way I was trying...
 

colinsp

Colin
Joined
Sep 5, 2007
Messages
2,325
Simplistically vertical alignment only works in tables and not div's. So if you follow Method 2 on that link you should be good to go. Create an appropriate class in your css and apply that class to your p tag where you are having problems.
 

JiminSA

Jim
Thread Starter
Joined
Dec 15, 2011
Messages
3,406
It's not quite that straight forward, Colin - the hack I did was to persuade some numeric text strings to align right in a table cell, but having achieved that, they dropped to vertically align themselves bottom and I was attempting to vertically align them top in the cell - but the CMS's css can not be overridden that way, it seems..
 

JiminSA

Jim
Thread Starter
Joined
Dec 15, 2011
Messages
3,406
I have settled for using str_pad to do the alignment as I cannot get table cell vertical alignment to override the CMS's table cell alignment, no matter what:confused:
... and now I am discovering that what php.net say about how str_pad operates, is not what actually happens:mad: So I shall be starting another thread about that;)
But thank you Colin for your patience and input(y)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top