Solved

white space in the write method

Posted on 1998-07-30
2
200 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

820 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