Solved

white space in the write method

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

809 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