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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dot leadrs in HTML

Status
Not open for further replies.

uthamsar

Programmer
Aug 1, 2001
13
0
0
US
Is there any way to get dot leaders in html tables? (in one column) For example:
Albania .........
Switzerland .....
United States ...
Is there any tag that we could use to repeat a single character several times?
Thanks !
 
You could write a function that loops through all your values then adds as many dots as necessary to make the line the same length. A server side script would be something like this. This is assuming that you are getting the names from a variable named country.

<%sub fix_length()
do while len(country)< x 'X being your fixed length
country = country&&quot;.&quot;
loop %>

Of course this is assuming that you are looping through your values to write them dynamically.

I hope it helps.
Roj
 
I tried a similar trick before I posted this message. I am actually creating an xml file (for 190 countries, for 4 years and around 30 variables) from Vb application using access database. Then I am using an XSL to create country sheets for all those countries. In one shot I could publish on the web and a camera ready printout for the publication. I was able to get evrything I need, superscripting the footnotes, running footer etc., but I want place dot leaders next to each variable name. The out put looks something like this:
United States
Colhead1 1998 1999 2000 2001
var 1 a a a a
var 2 b b b b
what I need is place the dot leaders after the variable name

var1 .......
var2abc ....
var1ab .....
I tried to use a loop in my vb application while I create the xml file.
But with the proportional font it did not work. As I am using XSL, I can not treat each variable separately since this style sheet works loops through each country and formats it accordingly.
Any way thanks for your reply.
 
You could perhaps use an onLoad handler to update the element values, and then use the String methods in Javascript, eg:

Code:
// assume foo points to the element we wish to alter
var dots = &quot;........................................&quot;;
var country = foo.value;
var countryDots = country.concat( dots.substr( dots.length - country.length ) );
foo.value = countryDots;

Hope this helps, cheers NEIL :)
 
Are you sure you absolutely need a dot leader? Wouldn't alternating 25% and 50% grey backgrounds work just as well?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top