Web Analytics Made Easy -
StatCounter Lining stuff up - CodingForum


No announcement yet.

Lining stuff up

  • Filter
  • Time
  • Show
Clear All
new 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.


  • #2
    put them in between <pre> </pre> tags or replace every space with &amp;nbsp;
    vBulletin Mods That Rock!


    • #3
      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....