Font size depend on table height

Discussion in 'HTML' started by Martin Johansen, Sep 20, 2004.

  1. Hello group

    Is there a way, using html and css, to have font be scaled after the
    height of the hosting table/div cell.

    Thanks.
    Martin Johansen, Sep 20, 2004
    #1
    1. Advertising

  2. (Martin Johansen) wrote:

    > Is there a way, using html and css, to have font be scaled after the
    > height of the hosting table/div cell.


    No.

    If you analyze (and maybe tell us, illustrating the issue with a URL)
    _why_ you would like to do so, you might end up with a solvable problem.
    It sounds very strange to want to make the font scale by the table height
    (which is impossible) and not vice versa (which is more than solvable -
    it happens if you _don't_ do anything to prevent it).

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Sep 20, 2004
    #2
    1. Advertising

  3. Martin Johansen

    Sid Ismail Guest

    On 20 Sep 2004 10:54:17 -0700, (Martin Johansen) wrote:

    : Hello group
    :
    : Is there a way, using html and css, to have font be scaled after the
    : height of the hosting table/div cell.


    The cell-size changes if you increase the font-size... cannot do it other
    way round.

    Sid
    Sid Ismail, Sep 21, 2004
    #3
  4. Martin Johansen

    SpaceGirl Guest

    Sid Ismail wrote:
    > On 20 Sep 2004 10:54:17 -0700, (Martin Johansen) wrote:
    >
    > : Hello group
    > :
    > : Is there a way, using html and css, to have font be scaled after the
    > : height of the hosting table/div cell.
    >
    >
    > The cell-size changes if you increase the font-size... cannot do it other
    > way round.
    >
    > Sid
    >


    <devils advocate>

    I think that might not be strictly true >:) While it might be stupid to
    try it you COULD... hmm if you know the height of the table in pix
    (which you could work out in JS), and you know the number of rows, you
    could write a lump of script to increase the size of your text via CSS
    properties :)

    </devils advocate>

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Sep 21, 2004
    #4
  5. Martin Johansen

    Martin Joh Guest

    "Jukka K. Korpela" <> wrote in message
    news:Xns956AEF2A0F6B4jkorpelacstutfi@193.229.0.31...
    > (Martin Johansen) wrote:
    >
    > > Is there a way, using html and css, to have font be scaled after the
    > > height of the hosting table/div cell.

    >
    > No.
    >
    > If you analyze (and maybe tell us, illustrating the issue with a URL)
    > _why_ you would like to do so, you might end up with a solvable problem.


    The practical problem is this. I am trying to avoid the use of pictures in
    order to fit all formating and data into a single html file, which are btw
    automatically generated by another program. One of the problems is scalable
    brackets around content depending of the contents of the hosting table, like
    the example below. Note that the contents may be another table with a lot of
    contents etc.

    <table>
    <tr>
    <td>(</td><td>contents</td><td>)</td>
    </tr>
    </table>

    > It sounds very strange to want to make the font scale by the table height
    > (which is impossible) and not vice versa (which is more than solvable -
    > it happens if you _don't_ do anything to prevent it).
    >
    > --
    > Yucca, http://www.cs.tut.fi/~jkorpela/
    > Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    >
    >
    Martin Joh, Sep 21, 2004
    #5
  6. "Martin Joh" <> wrote:

    >> If you analyze (and maybe tell us, illustrating the issue with a
    >> URL) _why_ you would like to do so, you might end up with a solvable
    >> problem.

    >
    > The practical problem is this. I am trying to avoid the use of
    > pictures in order to fit all formating and data into a single html
    > file, which are btw automatically generated by another program.


    You are only describing a wrong attempt at attacking some unspecified
    problem, not the original problem itself, and you didn't post a URL.

    How do pictures come into the picture, and how is the single HTML file
    idea involved? You are just listing unrelated concepts.

    > One
    > of the problems is scalable brackets


    Brackets?

    > around content depending of the
    > contents of the hosting table, like the example below. Note that the
    > contents may be another table with a lot of contents etc.
    >
    > <table>
    > <tr>
    > <td>(</td><td>contents</td><td>)</td>
    > </tr>
    > </table>


    Don't try to scale parentheses, or brackets for that matter. Setting the
    size would be just one of the unsolvable problems.

    Why should the contents appear between some huge parentheses? Having no
    idea of what the page really contains, I can just suggest that you should
    probably use some borders around a block. With the given snippet, there
    is no reason to assume that you need a table at all. You could simply put
    the contents inside a block (<p>, <div>, whatever) and suggest left and
    right borders for it in CSS. Or if you really want to use just HTML for
    that, you could do so too, using the less widely known attributes of
    <table> (basically <table frame="vsides" border="3">, for a single-
    cell table, for some value of "3").

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Sep 21, 2004
    #6
  7. Martin Johansen

    Sid Ismail Guest

    On Tue, 21 Sep 2004 14:30:14 +0100, SpaceGirl
    <> wrote:

    : Sid Ismail wrote:
    : > On 20 Sep 2004 10:54:17 -0700, (Martin Johansen) wrote:
    : >
    : > : Hello group
    : > :
    : > : Is there a way, using html and css, to have font be scaled after the
    : > : height of the hosting table/div cell.
    : >
    : >
    : > The cell-size changes if you increase the font-size... cannot do it other
    : > way round.
    : >
    : > Sid
    : >
    :
    : <devils advocate>
    :
    : I think that might not be strictly true >:) While it might be stupid to
    : try it you COULD... hmm if you know the height of the table in pix
    : (which you could work out in JS), and you know the number of rows, you
    : could write a lump of script to increase the size of your text via CSS
    : properties :)
    :
    : </devils advocate>


    Original poster said ".. using html and css.."

    ?? JS ??

    Sid
    Sid Ismail, Sep 21, 2004
    #7
  8. "SpaceGirl" <> wrote in message
    news:...
    > Sid Ismail wrote:
    > > On 20 Sep 2004 10:54:17 -0700, (Martin Johansen) wrote:
    > >
    > > : Hello group
    > > :
    > > : Is there a way, using html and css, to have font be scaled after the
    > > : height of the hosting table/div cell.
    > >
    > >
    > > The cell-size changes if you increase the font-size... cannot do it

    other
    > > way round.
    > >
    > > Sid
    > >

    >
    > <devils advocate>
    >
    > I think that might not be strictly true >:) While it might be stupid to
    > try it you COULD... hmm if you know the height of the table in pix
    > (which you could work out in JS), and you know the number of rows, you
    > could write a lump of script to increase the size of your text via CSS
    > properties :)
    >
    > </devils advocate>
    >
    > --
    >
    >
    > x theSpaceGirl (miranda)
    >
    > # lead designer @ http://www.dhnewmedia.com #
    > # remove NO SPAM to email, or use form on website #


    Thanks Space Girl, thats a creative solution, skills like that are valued,
    i'll go forth and research your algorithm.

    And, as you understood, js is very much a part of the web domain of html and
    css, though it is not strictly a part of it

    Thanks again.
    Martin Johansen, Sep 22, 2004
    #8
    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. John A Grandy

    height of printed line for a certain font size

    John A Grandy, Nov 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    465
    John A Grandy
    Nov 17, 2004
  2. COHENMARVIN
    Replies:
    2
    Views:
    631
    Lucas Tam
    Sep 12, 2005
  3. dave richards
    Replies:
    2
    Views:
    600
    Paul Furman
    Feb 19, 2004
  4. Sunil

    On what does size of data types depend?

    Sunil, Oct 5, 2005, in forum: C Programming
    Replies:
    35
    Views:
    1,283
    Anonymous 7843
    Oct 12, 2005
  5. mttc
    Replies:
    2
    Views:
    2,366
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page