Tab Function Needed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis M. Marks

    Tab Function Needed

    Has anyone developed a function that can determine the width of a text
    string using a proportional font? I would like to do this in order to
    insert a variable number of spaces after the text to simulate a tab.

    --
    Dennis M. Marks


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
  • Lasse Reichstein Nielsen

    #2
    Re: Tab Function Needed

    "Dennis M. Marks" <denmarks@dcsi. net> writes:
    [color=blue]
    > Has anyone developed a function that can determine the width of a text
    > string using a proportional font? I would like to do this in order to
    > insert a variable number of spaces after the text to simulate a tab.[/color]

    Before trying that, you should know that multiple spaces in HTML are
    collapsed, and even if you use non-breaking spaces (which don't
    collapse either) or a CSS whitespace setting that prevents it, you
    can't aim precisely with spaces. Your "tabs" won't be aligned, because
    you can only add an integer multiplum of the width of a space.

    I would try to find another way of implementing "tabs".
    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • swp

      #3
      Re: Tab Function Needed

      Lasse Reichstein Nielsen <lrn@hotpop.com > wrote in message news:<fzfqtrhn. fsf@hotpop.com> ...[color=blue]
      > "Dennis M. Marks" <denmarks@dcsi. net> writes:
      >[color=green]
      > > Has anyone developed a function that can determine the width of a text
      > > string using a proportional font? I would like to do this in order to
      > > insert a variable number of spaces after the text to simulate a tab.[/color]
      >
      > Before trying that, you should know that multiple spaces in HTML are
      > collapsed, and even if you use non-breaking spaces (which don't
      > collapse either) or a CSS whitespace setting that prevents it, you
      > can't aim precisely with spaces. Your "tabs" won't be aligned, because
      > you can only add an integer multiplum of the width of a space.
      >
      > I would try to find another way of implementing "tabs".
      > /L[/color]

      perhaps I am misunderstandin g what you are trying to do, but wouldn't
      it be very easy to simulate this with a table that has borders turned
      off?

      swp

      Comment

      • Dennis M. Marks

        #4
        Re: Tab Function Needed

        In article <fzfqtrhn.fsf@h otpop.com>, Lasse Reichstein Nielsen
        <lrn@hotpop.com > wrote:
        [color=blue]
        > "Dennis M. Marks" <denmarks@dcsi. net> writes:
        >[color=green]
        > > Has anyone developed a function that can determine the width of a text
        > > string using a proportional font? I would like to do this in order to
        > > insert a variable number of spaces after the text to simulate a tab.[/color]
        >
        > Before trying that, you should know that multiple spaces in HTML are
        > collapsed, and even if you use non-breaking spaces (which don't
        > collapse either) or a CSS whitespace setting that prevents it, you
        > can't aim precisely with spaces. Your "tabs" won't be aligned, because
        > you can only add an integer multiplum of the width of a space.
        >
        > I would try to find another way of implementing "tabs".
        > /L[/color]

        I was able to do it using monospace fonts but I don't like the look of
        the font. Can someone recommend the monospace font to use that would
        look better?

        http:www.dcs-chico.com/~denmarks/amtrak.html

        There is a "tab" between the train name and station names in the first
        select box.

        P.S. It would still be nice to have a way to do it with proportional
        fonts.

        --
        Dennis M. Marks


        -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
        http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
        -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: Tab Function Needed

          Dennis M. Marks wrote:
          [color=blue]
          > I was able to do it using monospace fonts but I don't like the look of
          > the font. Can someone recommend the monospace font to use that would
          > look better?[/color]

          Use "Courier New" as first alternative. But the font renders very
          small here anyway. And you should try not to use `px' but `em'.
          Unfortunately, IE is unable to scale content formatted with font-size:...px;
          [color=blue]
          > There is a "tab" between the train name and station names in the first
          > select box.[/color]

          There is nothing, not even a list if JavaScript is disabled or not
          supported.
          [color=blue]
          > P.S. It would still be nice to have a way to do it with proportional
          > fonts.[/color]

          Why don't you use a table? You *have* tabular data here. Use the
          first column of the table as container for a group of radio buttons,
          the second for the train name and the third for the description.
          With a server-side application to process the selected train on submit,
          you could accomplish this to be suitable for users with and without
          client-side JavaScript support.


          PointedEars

          Comment

          • Dennis M. Marks

            #6
            Re: Tab Function Needed

            In article <a59bd1d2.03121 20559.5de394b@p osting.google.c om>, swp
            <DSAsteve@aol.c om> wrote:
            [color=blue]
            > Lasse Reichstein Nielsen <lrn@hotpop.com > wrote in message
            > news:<fzfqtrhn. fsf@hotpop.com> ...[color=green]
            > > "Dennis M. Marks" <denmarks@dcsi. net> writes:
            > >[color=darkred]
            > > > Has anyone developed a function that can determine the width of a text
            > > > string using a proportional font? I would like to do this in order to
            > > > insert a variable number of spaces after the text to simulate a tab.[/color]
            > >
            > > Before trying that, you should know that multiple spaces in HTML are
            > > collapsed, and even if you use non-breaking spaces (which don't
            > > collapse either) or a CSS whitespace setting that prevents it, you
            > > can't aim precisely with spaces. Your "tabs" won't be aligned, because
            > > you can only add an integer multiplum of the width of a space.
            > >
            > > I would try to find another way of implementing "tabs".
            > > /L[/color]
            >
            > perhaps I am misunderstandin g what you are trying to do, but wouldn't
            > it be very easy to simulate this with a table that has borders turned
            > off?
            >
            > swp[/color]

            I have a <form><select>< option> list. The selection list contains train
            name followed by first/last station. I wanted the latter to be tabbed
            from the first. I was able to do it with a monospace font. See

            I thought it would be nice to use a proportional font.

            --
            Dennis M. Marks


            -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
            http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
            -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

            Comment

            Working...