Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Lining stuff up

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lining stuff up

    Hi all.

    I have a character field in a data table which is seven characters long and the characters that it contains can occur anywhere within the field. In fact when a given character does occur it always occurs in the same place.

    For simplicity, let's say that the possible codes are a,b,c,d,e,f,g. Then when "d" occurs it occurs in the 4th position of the field, when "a" occurs it occurs in the 1st position of the field etc.

    So I might have the following records:

    "ab d fg"
    " b de "
    " cd "
    " fg"
    "a d "

    When I write these into a <table><tr><td>...</td></tr></table> everything "comes together". For example, the bottom record appears as "ad" without any spaces in between the "a" and "d".

    Is it possible to get the values in the fields for these records to line up properly in a table, with all the "a"s in the same vertical line, all the "b"s in the same vertical line etc.?

    Have tried using &nbsp at the beginning of the <td> but that doesn't work.

    Any help would be appreciated.

    Russell.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    put them in between <pre> </pre> tags or replace every space with &amp;nbsp;
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Or, you could simply have a single cell for every entry.... say like if you don't have anything in the cell, just put &nbsp; and then start the next cell....


  •  

    Posting Permissions

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