Solved

white space in the write method

Posted on 1998-07-30
2
189 Views
Last Modified: 2010-04-09
how do I insert white space when using the write
method.
for example I want
the output to be like so
wriiten text        <few spaces>    variable

neither of the following  work.
1/call window.document.write("written text :                     "& variable&"<BR>")


2/
str = Space(10)
 call License_details_frame.document.write("written text : "&str2&variable&"<BR>")
0
Comment
Question by:martythegreat
  • 2
2 Comments
 
LVL 6

Accepted Solution

by:
alamo earned 20 total points
ID: 1844966
Printing HTML with document.write isn't any different than writing HTML directly: under HTML browsers usually combine multiple whitespace into one.

The best way I've seen is to use  &nbsp; instead of a space - though I am not certain all browsers handle it properly. The other typical ways (put it in a table, use a transparent image of a given size) have drawbacks, though they are occasionally Ok.

So you would do somethink like:
document.write("written text :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"& variable&"<BR>")

Hope this helps!
0
 
LVL 6

Expert Comment

by:alamo
ID: 1844967
martythegreat, experts exchange is a place where people try to help others, for no financial compensation. Part of the nonfinancial compensation is the grading system, the "points" which at least in a small way allow people to express their thanks for the help they receive. By not grading your questions and letting most of them autograde to a "C" due to inactivity, as appears to be your practice, you are effectively spitting in the faces of the people who help you.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now