Character width and alignment

Discussion in 'CSS' started by dimi, Mar 4, 2007.

  1. #1
    Hi all,
    i't traing to fix some phone contacts to be on the same position via X
    but this seems not easy , for example

    variant 1)
    GSM: +101 222 222 222
    tel.: +202 333 333 333

    variant 2)
    GSM: +101 222 222 222
    tel.: +202 333 333 333

    this is not possible by adding (removing of spaces) because the with of characters is not the samem and + is not in the same column like into line below (or above)

    Did you know some trick to do this task or i must use typewriter font or someting else
     
    dimi, Mar 4, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Try this:
    
    <style type="text/css">
    .c1 { text-align:left; }
    .c2 { text-align:right; font-family: monospace; padding: 0px 0px 0px 5px;}
    </style>
    
    <span class"c1">GSM:</span>
    <span class"c2">+101 222 222 222</span>
    <br />
    <span class"c1">tel.:</span>
    <span class"c2">+202 333 333 333</span>
    
    Code (markup):
     
    ajsa52, Mar 4, 2007 IP