Adding Leading spaces to String

Results 1 to 3 of 3

Thread: Adding Leading spaces to String

  1. #1
    Join Date
    Dec 1969

    Default Adding Leading spaces to String

    I am having problems adding leading spaces to a string... both methods I list below return the same thing, with only one space inserted.... I want to add two leading spaces.. how do I do it?<BR><BR>Result from both: &#039; 1000&#039;<BR>----------<BR>&#060;%<BR>Style = "1000"<BR>Style = "&#039;" & Space(2) & Style & "&#039;"<BR>%&#062;<BR>&#060;%=Style%&#062;<BR><BR >---------<BR><BR>&#060;%<BR>Style = "1000"<BR>Style = "&#039; " & Style & "&#039;"<BR>%&#062;<BR>&#060;%=Style%&#062;<BR >---------

  2. #2
    Join Date
    Dec 1969

    Default RE: Adding Leading spaces to String

    Both methods add TWO spaces. Check your HTML.<BR><BR>According to the HTML specification, whitespace can be collapsed.<BR><BR>This is designed behaviour.<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default Why are you trying to insert...

    ...more than one space? Are you trying to right-align numbers? If so, are you using a monospace font, such as Courier? If you don&#039;t use a monospace font, the numbers won&#039;t align properly anyway, because the digits will be different widths (a zero will be wider than a one for example) and the same is true for the space character.<BR><BR>If you want to right-align, why don&#039;t you use a table? If you just want to introduce a bigger gap, either use a transparent GIF or use the &amp;nbsp; character.<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts