|
-
Sep 28th, 2010, 04:18 PM
#1
Thread Starter
Hyperactive Member
Add space in html
I use " " to add non-break space between two controls in html.
Is there another way to do it?
-
Sep 28th, 2010, 04:40 PM
#2
Re: Add space in html
if there was, we wouldn't need the entity.
The only other way is to set the margin of one or both control in the CSS.
-tg
-
Sep 28th, 2010, 04:52 PM
#3
Frenzied Member
Re: Add space in html
hay,
actually why you need another way?
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Sep 28th, 2010, 08:41 PM
#4
Re: Add space in html
another way to add white space is by using the <pre> tag like so:
Code:
<pre>hello :)(: world</pre>
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Sep 29th, 2010, 01:12 AM
#5
Re: Add space in html
 Originally Posted by motil
another way to add white space is by using the <pre> tag like so:
Code:
<pre>hello :)(: world</pre>

motil,
Are you kidding? Please tell me you are kidding?
Gary
-
Sep 29th, 2010, 02:29 AM
#6
Re: Add space in html
It is A way... may or may not be the best way... but it is A way....
-tg
-
Sep 29th, 2010, 03:49 AM
#7
-
Sep 29th, 2010, 06:18 AM
#8
Re: Add space in html
Hey, do not dis the almighty PRE tag!
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Sep 29th, 2010, 07:00 AM
#9
Frenzied Member
Re: Add space in html
he asked about ways and she provide another
http://www.w3schools.com/tags/tag_pre.asp
may be this is the thing he is looking for, but he have to till us why he is looking for it
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Sep 29th, 2010, 07:44 AM
#10
Re: Add space in html
 Originally Posted by motil
Hey, do not dis the almighty PRE tag! 
-
Sep 29th, 2010, 08:17 AM
#11
Thread Starter
Hyperactive Member
Re: Add space in html
I tried but <pre> only works for text.
What I want to do is adding 100 space between two lables like below:
<asp:Label ID="lbl1" runat="server" /> <asp:Label ID="lbl2" runat="server"/>
If I use <pre> will make lbl2 in next line which I do not like it.
<asp:Label ID="lbl1" runat="server" />
<pre><asp:Label ID="lbl2" runat="server"/></pre>
-
Sep 29th, 2010, 08:22 AM
#12
Re: Add space in html
do you have enough space ? maybe that is the reason it's break.
and as tg suggested the more common way of doing this is to set lbl1 margin-right to 100px (or what ever space you need)
note: the label you are using will be rendered has <span> tag so you can only apply left-right margin
like so:
Code:
<style type='text/css'>
#lbl1 {margin:0 100px 0 0;}
</style>
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Sep 29th, 2010, 08:25 AM
#13
Re: Add space in html
aspfun - I think the suggestion was to put pre tag BETWEEN your labels... not to put one label inside the pre tag...
I dunno... something still doesn't feel quite right about this...
What's the reason for the 100 spaces?
-tg
-
Sep 29th, 2010, 08:53 AM
#14
Re: Add space in html
I Haven't noticed your code sample but yes i mean to use it like this:
Code:
<asp:Label ID="lbl1" runat="server" />
<pre> </pre>
<asp:Label ID="lbl2" runat="server"/>
but i still will go with the margin-right CSS property.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Sep 29th, 2010, 08:58 AM
#15
Thread Starter
Hyperactive Member
Re: Add space in html
motil, I tried your code but it make lbl2 in next line.
-
Sep 29th, 2010, 09:06 AM
#16
Re: Add space in html
i think that's mean that the container of the two labels is to small for space size you're trying to add.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Sep 29th, 2010, 09:07 AM
#17
Re: Add space in html
Can you post all the code that you are using?
Gary
-
Sep 29th, 2010, 09:12 AM
#18
Thread Starter
Hyperactive Member
Re: Add space in html
Here is code. There are 10 views in MultiView but I test in view1
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
<table width="870" cellpadding="0" cellspacing="0">
<tr valign="top">
<td >
<br />
<br />
<asp:Label ID="lbl1" runat="server" Text="111"/>
<pre> </pre>
<asp:Label ID="lbl2" runat="server" Text="222"/>
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
-
Sep 29th, 2010, 09:33 AM
#19
Re: Add space in html
Okay, so this is very much related to your other thread that you have here:
http://www.vbforums.com/showthread.php?t=628879
In there, the recommendation was that you use CSS to control your layout.
Gary
-
Sep 29th, 2010, 09:35 AM
#20
Thread Starter
Hyperactive Member
Re: Add space in html
Yes, I'll do CSS. I think that this is the only way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|