Calculating the width of an element

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I want to make a table of links on my page. However, because different users
will have different screen widths, I will need to calculate the number of
columns based on the screen width and width of the table's data. How can I
determine, in pixels, the width of a given piece of text? Any help would be
appreciated. Thanks.
 
Nathan Sokalski said:
I want to make a table of links on my page. However, because different
users will have different screen widths, I will need to calculate the
number of columns based on the screen width and width of the table's data.
How can I determine, in pixels, the width of a given piece of text?

This would require a client-side script (VBScript, JScript, JavaScript), if
there is a clean solution at all. However, using client-side scripts
require the user to have scripting enabled.
 
Back
Top