WEB formatting text with '....'

Discussion in 'OT Technology' started by Kewlb, Jan 25, 2008.

  1. Kewlb

    Kewlb New Member

    Joined:
    Nov 21, 2002
    Messages:
    1,510
    Likes Received:
    0
    formatting text with '....' -- $5.00 reward

    Hey,

    Is there a simple way to format text spacing using a . instead of a space to justify the text.

    ie:

    entry 1 .........................Text Here
    Another Entry ................Text Here
    Entry x .........................Text Here

    etc...

    I need to ensure that the left side and right side align perfectly. I know I could do this with tables -- but it looks wierd formatted as a table.

    The length of the right side text will vary from item to item and report to report.

    $5.00 via Paypal to whoever comes up with a viable solution
     
    Last edited: Jan 25, 2008
  2. Yuppy

    Yuppy Have a seat right there....

    Joined:
    Jan 7, 2007
    Messages:
    12,589
    Likes Received:
    0
    Location:
    THE Hawkeye Nation
    tables no border?

    idk.

    i read the first half before posting.... the right side text, right aligned or you can left align the stuff on the right.......
     
  3. Kewlb

    Kewlb New Member

    Joined:
    Nov 21, 2002
    Messages:
    1,510
    Likes Received:
    0
    $5.00 reward for whoever comes up with a viable solution -- paid right away to the first person via paypal.
     
  4. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    what is the big picture
     
  5. Kewlb

    Kewlb New Member

    Joined:
    Nov 21, 2002
    Messages:
    1,510
    Likes Received:
    0

    near plain-text HTML reports from a backend database containing economic data. The url can also be fed through a url->pdf asp.net component to turn it into a pdf that is streamed to the browser.
     
  6. Zac

    Zac New Member

    Joined:
    Nov 24, 2006
    Messages:
    151
    Likes Received:
    0
    Used a table to make it easier to keep em lined up but here's the dots...
    [​IMG]
    I just put a image of dots as a background for the table cells...

    The dots are made using a 4x1 gif...half transparent, half black. You can make the gif taller and align it at the bottom to line up with the text if you want.

    Code:
    <style type="text/css">
     table.test {
      border: 0;
      width: 300px;
     }
     table.test td {
      background: url(dots.gif) repeat-x center left;
     }
     table.test td span {
      background-color: #FFFFFF;
      padding: 0 3px;
     }
     table.test td.z {
      background-image: none;
     }
    </style>
    <table class="test">
     <tr>
      <td><span>entry 1</span></td>
      <td class="z">Text Here</td>
     </tr>
     <tr>
      <td><span>Entry x</span></td>
      <td class="z">Text Here</td>
     </tr>
     <tr>
      <td><span>Another Entry</span></td>
      <td class="z">Text Here</td>
     </tr>
    </table>
    
     
  7. Kewlb

    Kewlb New Member

    Joined:
    Nov 21, 2002
    Messages:
    1,510
    Likes Received:
    0
    Let me test this -- If it works and converts to a pdf correctly I'll pm you for your paypal e-mail address.

    this solution worked and converted to pdf using a .net component perfectly.
     
    Last edited: Jan 25, 2008
  8. jdw

    jdw New Member

    Joined:
    Dec 31, 2005
    Messages:
    4,429
    Likes Received:
    0
    Location:
    ND
    dammit, I KNOW I've seen a way to do this with straight code but I'll be damned if I even remember what language it was in.
     
  9. Kewlb

    Kewlb New Member

    Joined:
    Nov 21, 2002
    Messages:
    1,510
    Likes Received:
    0
    I am sure there is a way.. I was thinking about taking the len() of the string and replacing that many "." with text -- but since character size does not always equal a single "." it did not work out too well.
     
  10. Zac

    Zac New Member

    Joined:
    Nov 24, 2006
    Messages:
    151
    Likes Received:
    0
    Glad it worked out for ya man.

    ...and thanks for adding some $ to my beer fund :p
     
  11. LOLZILLA

    LOLZILLA New Member

    Joined:
    Jul 11, 2004
    Messages:
    97,923
    Likes Received:
    0
    should've bought an av.
     
  12. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Perl formatting will do this easily ...

    Code:
        format FORMAT_EXPIRED_ACCOUNTS =
        @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<| @<<<<<<<<<<<<<<<<<<<<<<<<| @<<<<<<<<<<<
        $realname,                        $studentno,                $login
        .
     

Share This Page