|
-
May 19th, 2004, 12:16 PM
#1
Thread Starter
Frenzied Member
Algorithm for figuring out width of td
So I've been doing some experimenting and I'm wondering if anyone else has played with this: How many pixels in width should be supplied for the average character or combination of characters.
I'm trying to figure out how wide to make my table columns in pixels based on the maximum number of characters that are in that column. I know that I can just not specify a width and it will fill out the table fairly nicely most of the time, but what if I want it to be exact?
Thoughts, suggestions?
-
May 19th, 2004, 12:21 PM
#2
Ex-Super Mod'rater
I've often wondered this but thought it would be impractical in the end with all fonts being different sizes and individual characters being different again. I find using "NOWRAP" in the TD tag does the job most the time. However its not useful when you want to calculate the next colums width by taking the last ones away. I'm sure this will be along the line you have made this thread but i just wanted to add to your question:
Can you find out how much of a table is left unused. Like when using frames you can use the * but you can't in tables, why not .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
May 19th, 2004, 01:04 PM
#3
Thread Starter
Frenzied Member
Well, I think that would be a simple solution. If you are building your table up dynamically, just keep track of what is being used up and then subtract that from your total width.
In my case, if I would decide to use a set width for the entire table, I have the issue of making sure that all my columns fit within that width... and for what I'm doing, that's not the case. The width of the table is based on the width of the sum of the columns' width.... and hence we go back to my origional problem.
-
May 23rd, 2004, 03:54 AM
#4
It's not possible to calculate it because the user might be using a different font, a different size, you get the idea.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|