Tabs

Discussion in 'HTML' started by Neal, Jul 16, 2004.

  1. Neal

    Neal Guest

    On Fri, 16 Jul 2004 23:19:49 -0700, Ed <> wrote:

    > Hi,
    >
    > I writing an application which converts documents to HTML. At the moment
    > I'm converting tabs in the original document to:
    >
    > &nbsp;&nbsp;&nbsp;&nbsp;
    >
    > which as you can imagine, is quite messy. Does anyone know another way
    > of
    > inserting tabs into a HTML document?
    >
    > Thanks,
    >
    >



    The solution would depend on *why* you are using the tabs. Is it a chart?
    Use table markup. Is it a paragraph indent? <p style="text-indent:
    4em;">djdjd</p>. There are other possibilities.
     
    Neal, Jul 16, 2004
    #1
    1. Advertising

  2. Neal

    Sid Ismail Guest

    On Fri, 16 Jul 2004 23:19:49 -0700, "Ed" <> wrote:

    : Hi,
    :
    : I writing an application which converts documents to HTML. At the moment
    : I'm converting tabs in the original document to:
    :
    : &nbsp;&nbsp;&nbsp;&nbsp;
    :
    : which as you can imagine, is quite messy. Does anyone know another way of
    : inserting tabs into a HTML document?


    Tables? Or use a spacer.gif? URL ?

    Sid
     
    Sid Ismail, Jul 17, 2004
    #2
    1. Advertising

  3. Neal

    Webcastmaker Guest

    In article <cd9kau$4ta$>, says...
    > I writing an application which converts documents to HTML. At the moment
    > I'm converting tabs in the original document to:
    > &nbsp;&nbsp;&nbsp;&nbsp;
    > which as you can imagine, is quite messy. Does anyone know another way of
    > inserting tabs into a HTML document?


    See if you can get your program to make some assumptions about how
    the tabs are used. For example if there is a single tab right after
    a line feed, followed by a capital letter, then more than likely it
    is the beginning of a paragraph where you can easily use some CSS to
    make up the space. If it is several tabs in a row, then it is
    probably a center. And if it is tab-text-tab-text-tab then it is
    probably data for a table.

    You know the documents, you would probably be the best at deciding
    which assumptions work most of the time. Then you can automate the
    majority of your work.
    --
    WebcastMaker
    The easiest and most affordable way to create
    Web casts, or put presentations on the Web.
    www.webentations.com
     
    Webcastmaker, Jul 17, 2004
    #3
  4. Neal

    Ed Guest

    Hi,

    I writing an application which converts documents to HTML. At the moment
    I'm converting tabs in the original document to:

    &nbsp;&nbsp;&nbsp;&nbsp;

    which as you can imagine, is quite messy. Does anyone know another way of
    inserting tabs into a HTML document?

    Thanks,
     
    Ed, Jul 17, 2004
    #4
  5. Neal

    Toby Inkster Guest

    Ed wrote:

    > I writing an application which converts documents to HTML. At the moment
    > I'm converting tabs in the original document to:
    > &nbsp;&nbsp;&nbsp;&nbsp;


    That's arguably the best way for an automated converter to do it.

    Another method might be:
    <span class="tab"> </span>

    with this style-sheet:
    span.tab { padding-left: 4em; }

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Now Playing ~ ./keane_-_everybodys_changing.ogg
     
    Toby Inkster, Jul 17, 2004
    #5
  6. Neal

    Mitja Guest

    Ed <>
    (news:cdau0c$80v$) wrote:
    > "Ed" <> wrote in message
    > news:cd9kau$4ta$...
    >> Hi,
    >>
    >> I writing an application which converts documents to
    >> HTML. At the moment I'm converting tabs in the original
    >> document to:
    >>
    >> &nbsp;&nbsp;&nbsp;&nbsp;
    >>
    >> which as you can imagine, is quite messy. Does anyone
    >> know another way of inserting tabs into a HTML document?
    >>
    >> Thanks,
    >>
    >>

    >
    > Thanks for your replies.
    >
    > Basically I want to convert the tabs in the original
    > documents to spaces. The number of spaces per tab is
    > decided by the user. By using &nbsp; I get the desired
    > result, but the HTML source is unreadable (it's just full
    > of &nbsp;). Does anyone know any alternatives?


    It was said more than once: it depends on the use of tabs. Could you show us
    an example of a document you're trying to convert?
     
    Mitja, Jul 17, 2004
    #6
  7. Neal

    Dylan Parry Guest

    Ed wrote:

    > It looks like using <PRE> </PRE> could solve my problem. I've
    > inserted a <FONT FACE="courier new"> statement inside the <PRE> block.
    > Could doing this cause any problems? Is it better to let the <PRE>
    > statement select the font?


    I think actually that <pre> probably is the best solution for what you are
    proposing, but I would suggest using CSS to set the font for the element,
    and not font elements :)

    --
    Dylan Parry
    http://www.webpageworkshop.co.uk - FREE Web tutorials and references

    Now playing: Pink Floyd - Keep Talking
     
    Dylan Parry, Jul 17, 2004
    #7
  8. Neal

    Mitja Guest

    Ed <>
    (news:cdb462$md6$) wrote:
    > "Mitja" <> wrote in message
    > news:eek:L7Kc.175$...
    >> Ed <>
    >> (news:cdau0c$80v$) wrote:
    >>> "Ed" <> wrote in message
    >>> news:cd9kau$4ta$...
    >>>> Hi,
    >>>>
    >>>> I writing an application which converts documents to
    >>>> HTML. At the moment I'm converting tabs in the
    >>>> original document to:
    >>>>
    >>>> &nbsp;&nbsp;&nbsp;&nbsp;
    >>>>
    >>>> which as you can imagine, is quite messy. Does anyone
    >>>> know another way of inserting tabs into a HTML
    >>>> document?
    >>>>
    >>>> Thanks,
    >>>>
    >>>>
    >>>
    >>> Thanks for your replies.
    >>>
    >>> Basically I want to convert the tabs in the original
    >>> documents to spaces. The number of spaces per tab is
    >>> decided by the user. By using &nbsp; I get the desired
    >>> result, but the HTML source is unreadable (it's just
    >>> full of &nbsp;). Does anyone know any alternatives?

    >>
    >> It was said more than once: it depends on the use of
    >> tabs. Could you show us an example of a document you're
    >> trying to convert?
    >>
    >>

    >
    > The type of document is VHDL source code. Here is an
    > example of some code:
    >
    > main : process(RST, MCLK)
    > begin
    > if RST = '0' then
    > clock <= '1';
    > edge_count <= 0;
    > elsif rising_edge(MCLK) then
    > if edge_count = 3 then
    > clock <= not clock;
    > edge_count <= 0;
    > else
    > edge_count <= edge_count + 1;
    > end if;
    > end if;
    > end process main;
    >
    > All of the tabs are from the left hand margin (e.g. no
    > text is centered or right hand justified).


    In that case, I'd go for <pre>. If you want to color the code, you can still
    nest <span>s inside that:

    pre span { color:red }

    <pre>
    <span>function</span> foo()
    <span>begin</span>
    print(<span>"foo bar"</span>);
    <span>end;</span>
    </pre>

    This example doesn't use classes, you'll probably want to introduce things
    like span.keyword, span.string, ...
     
    Mitja, Jul 17, 2004
    #8
  9. Neal

    Mitja Guest

    Ed <>
    (news:cdb505$van$) wrote:
    > "Ed" <> wrote in message
    > news:cdb462$md6$...
    >>
    >> "Mitja" <> wrote in message
    >> news:eek:L7Kc.175$...
    >>> Ed <>
    >>> (news:cdau0c$80v$) wrote:
    >>>> "Ed" <> wrote in message
    >>>> news:cd9kau$4ta$...
    >>>>> Hi,
    >>>>>
    >>>>> I writing an application which converts documents to
    >>>>> HTML. At the moment I'm converting tabs in the
    >>>>> original document to:
    >>>>>
    >>>>> &nbsp;&nbsp;&nbsp;&nbsp;
    >>>>>
    >>>>> which as you can imagine, is quite messy. Does anyone
    >>>>> know another way of inserting tabs into a HTML
    >>>>> document?
    >>>>>
    >>>>> Thanks,
    >>>>>
    >>>>>
    >>>>
    >>>> Thanks for your replies.
    >>>>
    >>>> Basically I want to convert the tabs in the original
    >>>> documents to spaces. The number of spaces per tab is
    >>>> decided by the user. By using &nbsp; I get the desired
    >>>> result, but the HTML source is unreadable (it's just
    >>>> full of &nbsp;). Does anyone know any alternatives?
    >>>
    >>> It was said more than once: it depends on the use of
    >>> tabs. Could you show us an example of a document you're
    >>> trying to convert?
    >>>
    >>>

    >>
    >> The type of document is VHDL source code. Here is an
    >> example of some code:
    >>
    >> main : process(RST, MCLK)
    >> begin
    >> if RST = '0' then
    >> clock <= '1';
    >> edge_count <= 0;
    >> elsif rising_edge(MCLK) then
    >> if edge_count = 3 then
    >> clock <= not clock;
    >> edge_count <= 0;
    >> else
    >> edge_count <= edge_count + 1;
    >> end if;
    >> end if;
    >> end process main;
    >>
    >> All of the tabs are from the left hand margin (e.g. no
    >> text is centered or right hand justified).
    >>
    >>

    >
    > It looks like using <PRE> </PRE> could solve my
    > problem. I've inserted a <FONT FACE="courier new">
    > statement inside the <PRE> block. Could doing this cause
    > any problems? Is it better to let the <PRE> statement
    > select the font?


    Wow... what a delay. You post just appeared on my server. If you used
    <font>, you probably won't understand the example I gave in my previous
    post. I suggest reading a basic tutorial on css. Or maybe someone around
    here is patient enough to write it all down and explain it to you. I'm not
    ;)
     
    Mitja, Jul 17, 2004
    #9
  10. Neal

    Jeff Thies Guest

    Toby Inkster wrote:
    > Ed wrote:
    >
    >
    >>I writing an application which converts documents to HTML. At the moment
    >>I'm converting tabs in the original document to:
    >>&nbsp;&nbsp;&nbsp;&nbsp;

    >
    >
    > That's arguably the best way for an automated converter to do it.
    >
    > Another method might be:
    > <span class="tab"> </span>
    >
    > with this style-sheet:
    > span.tab { padding-left: 4em; }


    works in everything but IE5 (works in IE6). Thread on this in
    C.I.W.A.Stylesheets

    Cheers,
    Jeff
    >
     
    Jeff Thies, Jul 17, 2004
    #10
  11. Neal

    Ed Guest

    "Ed" <> wrote in message
    news:cd9kau$4ta$...
    > Hi,
    >
    > I writing an application which converts documents to HTML. At the moment
    > I'm converting tabs in the original document to:
    >
    > &nbsp;&nbsp;&nbsp;&nbsp;
    >
    > which as you can imagine, is quite messy. Does anyone know another way of
    > inserting tabs into a HTML document?
    >
    > Thanks,
    >
    >


    Thanks for your replies.

    Basically I want to convert the tabs in the original documents to spaces.
    The number of spaces per tab is decided by the user. By using &nbsp; I get
    the desired result, but the HTML source is unreadable (it's just full of
    &nbsp;). Does anyone know any alternatives?

    Thanks again,
     
    Ed, Jul 17, 2004
    #11
  12. Neal

    Toby Inkster Guest

    Jeff Thies wrote:
    > Toby Inkster wrote:
    >
    >> Another method might be:
    >> <span class="tab"> </span>
    >> with this style-sheet:
    >> span.tab { padding-left: 4em; }

    >
    > works in everything but IE5 (works in IE6).


    Possibly combine with 'width:3em' too.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Jul 17, 2004
    #12
  13. Neal

    Ed Guest

    "Mitja" <> wrote in message
    news:eek:L7Kc.175$...
    > Ed <>
    > (news:cdau0c$80v$) wrote:
    > > "Ed" <> wrote in message
    > > news:cd9kau$4ta$...
    > >> Hi,
    > >>
    > >> I writing an application which converts documents to
    > >> HTML. At the moment I'm converting tabs in the original
    > >> document to:
    > >>
    > >> &nbsp;&nbsp;&nbsp;&nbsp;
    > >>
    > >> which as you can imagine, is quite messy. Does anyone
    > >> know another way of inserting tabs into a HTML document?
    > >>
    > >> Thanks,
    > >>
    > >>

    > >
    > > Thanks for your replies.
    > >
    > > Basically I want to convert the tabs in the original
    > > documents to spaces. The number of spaces per tab is
    > > decided by the user. By using &nbsp; I get the desired
    > > result, but the HTML source is unreadable (it's just full
    > > of &nbsp;). Does anyone know any alternatives?

    >
    > It was said more than once: it depends on the use of tabs. Could you show

    us
    > an example of a document you're trying to convert?
    >
    >


    The type of document is VHDL source code. Here is an example of some code:

    main : process(RST, MCLK)
    begin
    if RST = '0' then
    clock <= '1';
    edge_count <= 0;
    elsif rising_edge(MCLK) then
    if edge_count = 3 then
    clock <= not clock;
    edge_count <= 0;
    else
    edge_count <= edge_count + 1;
    end if;
    end if;
    end process main;

    All of the tabs are from the left hand margin (e.g. no text is centered or
    right hand justified).
     
    Ed, Jul 17, 2004
    #13
  14. Neal

    Ed Guest

    "Ed" <> wrote in message
    news:cdb462$md6$...
    >
    > "Mitja" <> wrote in message
    > news:eek:L7Kc.175$...
    > > Ed <>
    > > (news:cdau0c$80v$) wrote:
    > > > "Ed" <> wrote in message
    > > > news:cd9kau$4ta$...
    > > >> Hi,
    > > >>
    > > >> I writing an application which converts documents to
    > > >> HTML. At the moment I'm converting tabs in the original
    > > >> document to:
    > > >>
    > > >> &nbsp;&nbsp;&nbsp;&nbsp;
    > > >>
    > > >> which as you can imagine, is quite messy. Does anyone
    > > >> know another way of inserting tabs into a HTML document?
    > > >>
    > > >> Thanks,
    > > >>
    > > >>
    > > >
    > > > Thanks for your replies.
    > > >
    > > > Basically I want to convert the tabs in the original
    > > > documents to spaces. The number of spaces per tab is
    > > > decided by the user. By using &nbsp; I get the desired
    > > > result, but the HTML source is unreadable (it's just full
    > > > of &nbsp;). Does anyone know any alternatives?

    > >
    > > It was said more than once: it depends on the use of tabs. Could you

    show
    > us
    > > an example of a document you're trying to convert?
    > >
    > >

    >
    > The type of document is VHDL source code. Here is an example of some

    code:
    >
    > main : process(RST, MCLK)
    > begin
    > if RST = '0' then
    > clock <= '1';
    > edge_count <= 0;
    > elsif rising_edge(MCLK) then
    > if edge_count = 3 then
    > clock <= not clock;
    > edge_count <= 0;
    > else
    > edge_count <= edge_count + 1;
    > end if;
    > end if;
    > end process main;
    >
    > All of the tabs are from the left hand margin (e.g. no text is centered or
    > right hand justified).
    >
    >


    It looks like using <PRE> </PRE> could solve my problem. I've inserted a
    <FONT FACE="courier new"> statement inside the <PRE> block. Could doing
    this cause any problems? Is it better to let the <PRE> statement select the
    font?
     
    Ed, Jul 17, 2004
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nospam
    Replies:
    2
    Views:
    5,201
    Joe Smith
    Jul 3, 2004
  2. TomTom
    Replies:
    1
    Views:
    395
    PeterOo
    Aug 26, 2003
  3. qwweeeit
    Replies:
    2
    Views:
    649
    qwweeeit
    Dec 14, 2005
  4. rantingrick

    Tabs -vs- Spaces: Tabs should have won.

    rantingrick, Jul 16, 2011, in forum: Python
    Replies:
    95
    Views:
    1,836
    Roy Smith
    Jul 19, 2011
  5. John Kopanas
    Replies:
    2
    Views:
    294
    Gregory Brown
    Jan 29, 2007
Loading...

Share This Page