Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determining cell width

Status
Not open for further replies.

bccamp

Technical User
Jan 20, 2005
69
0
0
I have a table on a webpage with 4 distinct columns. The first column contains descriptions and 1 of the other 3 to the right will contain data. I want to determine the size of the first field, after the descriptions, so that it will print "." or "-" to the end of the cell without forcing the cell to be wider than it normally would. Something like:

data 1...................500
this is data 2..........600

I hope I'm being clear enough. I just want to know how many "." to put in each cell to make the "500" and "600" line up taking into account different resolution monitors are going to expand or contract the actual page. Thanks.
 
yes, The fonts are the same
 
that's not what i asked.

if you are using a monospaced font then there is no way (that I know) to do what you want. you can fudge it by putting the left hand data in a span of a fixed width and setting the overflow to hidden, then putting the number in an adjacent span. you can get more help on this from Forum215

if the font is monospaced then all you need to do is calculated the length of each left hand side (strlen()) and add in the requisite number of dots.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top