[thelist] Dotted line to fill table cell?

Chris Blessing webguy at mail.rit.edu
Sun Mar 10 22:08:01 CST 2002


Rachel-

If you don't have the option of using some sort of image with some
server-side width= magic, you could perhaps try using a fixed-width font and
javascript to count the number of characters filling the first portion of
the table cell, then tack on the difference in dots.  Example...

String in cell:
   var strItem = "Blah this is a string";

String in cell's length (21 chars):
   var strItemLen = strItem.length;

Total width of table cell in characters:
   var intTotalLen = 50;

Figure out how many dots we need to add on:
   var intDotsToAdd = intTotalLen - strItemLen;

Compose and write the new string:
   var strNewItem = strItem;
   for(var i=0; i<intDotsToAdd; i++){
      strNewItem += ".";
   }
   document.writeln("<TD>" + strNewItem + "</TD>");

Of course this might be totally impossible given the fact that I'm not sure
of your exact situation, but it may be a starter!

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

>I'm looking for a way to fill the remaining space in a table cell >with a
>dotted line - using html/css.. any pointers much appreciated..

>Rachel




More information about the thelist mailing list