CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    37

    getting the string.length in pixel / JavaScript

    hi there,

    can I get the amount of pixel out of the length of an string in JavaScript?
    I have a table with several columns and each of this column has a fixed height and width. Now I want to put some text into the columns (TDs) and if the text ist too long to fit into the column HTML will normally strech the TD or make a new line, this is what I want to avoid. The result should look like in the WinExplorer, if you cut the text there should be concatinated '...' at the end of the cutted string.

    So at least I need to have a functionallity to get the width of a letter in pixel depending on the chosen font aso...

    thanx for your patience,
    just a rookie.

  2. #2
    Join Date
    Jan 2003
    Location
    North Carolina
    Posts
    309
    To the best of my knowledge javascript does not have any functionality that allows this ability.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured