Results 1 to 20 of 20

Thread: Add space in html

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    Add space in html

    I use " " to add non-break space between two controls in html.
    Is there another way to do it?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Frenzied Member avrail's Avatar
    Join Date
    Mar 2006
    Location
    Egypt, Cairo
    Posts
    1,221

    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

  4. #4
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Add space in html

    Quote Originally Posted by motil View Post
    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

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Add space in html

    It is A way... may or may not be the best way... but it is A way....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

  8. #8
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  9. #9
    Frenzied Member avrail's Avatar
    Join Date
    Mar 2006
    Location
    Egypt, Cairo
    Posts
    1,221

    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

  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Add space in html

    Quote Originally Posted by motil View Post
    Hey, do not dis the almighty PRE tag!

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    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>

  12. #12
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  13. #13
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  14. #14
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    Re: Add space in html

    motil, I tried your code but it make lbl2 in next line.

  16. #16
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  17. #17
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Add space in html

    Can you post all the code that you are using?

    Gary

  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    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>

  19. #19
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    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
  •  



Click Here to Expand Forum to Full Width