Solved

white space in the write method

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

895 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

12 Experts available now in Live!

Get 1:1 Help Now