Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

white space in the write method

Posted on 1998-07-30
2
Medium Priority
?
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 6

Accepted Solution

by:
alamo earned 40 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
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.…

718 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