Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to add whitespace

Status
Not open for further replies.

robulator

Programmer
Nov 17, 2000
33
US
I created a User Control which constructs a dropdown control dynamically. I'm trying to add whitespace between 2 parts of each entry as follows:

OperatorSelect.Items.Add(New ListItem(Value1 & "    " & Value2, Value3))

This gets interpreted so that "  " is displayed in the dropdown control(HTML comes out as   ).

How do I force whitespace to be added in the resulting HTML?

Thanks,

Rob
 
Did you type the & nbsp ; thing there, and TT made it come out as spaces? If so, try just plain ole white space...

If not, try the ascii code for a space (32), which you can find here:


as well as all the others (very useful url!)

:)
paul
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
Thanks for responding. I think I wasn't very clear in the first message. Adding blank space as " " is ignored by the browser. If I put "  " into the string, .Net turns it into    in the HTML, which displays as    instead of white space.

If I use Chr(32), it inserts blank spaces into the HTML which is ignored by the browser. I need for the resulting HTML to have    which will add whitespace.

Thanks,

Rob
 
I am confused. What was wrong with   
In your post you said it looks like instead of white space. But that looks very much like white space to me. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
This is funny because some of the text that I'm typing in these posts ends up being interpreted by the browser as whitespace so we can't see it. Let me try again. I will add spaces after ampersands so the browser doesn't misinterpret what I'm trying to say: "& nbsp;& nbsp;" turns into "& amp;nbsp;& amp;nbsp;" which is displayed by the browser as "& nbsp;& nbsp;".

Is this making any sense?????
 
Ahhh now I understand. I went and tried this and I am not sure that you can do such a thing. Actually I feel that you can but I just can't figure out how. One possibility would be to put " | " if you need to separate things. If I run across this I'll be sure to post. Likewise if you find a solution please post it. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top