JRS: In article <11**********************@e56g2000cwe.googlegroups .com>
, dated Tue, 14 Mar 2006 08:37:17 remote, seen in
news:comp.lang.javascript, DigMar <in**@digitalmarketing1.com> posted :
Thi is a newbie question regarding the spacing of words in a header
with links. I simply want to space the clickable words on my header bar
more horizontally. Here is my code to make more sense:
// HEADER MENU OPTIONS
document.write('<span class="header">');
document.write('<a href="index.html" target="_top">Home</a> <a
href="about.html" target="_top">The Company</a> <a
href="products.html"target="_top">Products</a> <a href="download.html"
target="_top">Downloads</a> <a href="contact.html"
target="_top">Contact</a><br>');
// -- END -->
I want the linked headers, Home, The Company, Products, Downloads and
Contact to be spaced apart more horizontally, maybe 10 spaces or so so
it doesn't look like a strange sentence. Can this be done?
Not really a javascript question; there might be a javascript answer.
When posting code, don't allow your agent to wrap lines; posted code
should be directly executable. See FAQ.
You could pad the gaps with alternate (or ) and space;
adding a pair of those should be enough.
You could deem it a Table, and mark it as such; that way, you could get
forms of spacing other than equal-gap.
You could use CSS, but you'll then have to consider whether the required
form of spacing is available in all target browsers. Word-spacing,
which you ask for, will probably not be satisfactory with an entry like
"The Company", but might be so with "The Company".
Your script could be compacted by setting, for example,
S1 = 'target="_top"' and using that repeatedly - only the filename and
the visible string need to be given each time. Not worthwhile for a
single use, but could be if multiply-used.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.