Table cell width fixed size

Discussion in 'HTML' started by Fabian Vilers, Apr 24, 2006.

  1. Hello all,

    I need to draw a table with fixed size (height + width) cells. In any
    case, the text should never expand the size of the cell.

    Any help is appreciated,
    Fabian
     
    Fabian Vilers, Apr 24, 2006
    #1
    1. Advertising

  2. __/ [ Fabian Vilers ] on Monday 24 April 2006 09:49 \__

    > Hello all,
    >
    > I need to draw a table with fixed size (height + width) cells. In any
    > case, the text should never expand the size of the cell.
    >
    > Any help is appreciated,
    > Fabian


    <table width=VALUEH style="height: VALUEVpx;">

    This table will have a fixed width VALUEH and a minimal height of VALUEV. It
    would not makes sense for the height to be strictly forced, however. This
    would lead to text disappearing and, mind you, tables cannot have scroll
    bars. This is adverse to user's desire and will (just about any stalwart
    advocate of standards would argue this). For this, you might wish to have a
    look into iframes, which are scrollable and have fixed dimensions.

    Hope it helps,

    Roy

    --
    Roy S. Schestowitz, Ph.D. Candidate in Medical Biophysics
    http://Schestowitz.com | SuSE Linux ¦ PGP-Key: 0x74572E8E
    12:20pm up 1 day 21:17, 9 users, load average: 0.62, 0.59, 0.49
    http://iuron.com - Open Source knowledge engine project
     
    Roy Schestowitz, Apr 24, 2006
    #2
    1. Advertising

  3. Fabian Vilers

    frederick Guest

    Fabian Vilers wrote:
    > I need to draw a table with fixed size (height + width) cells. In any
    > case, the text should never expand the size of the cell.


    Why on Earth not? What if the text's too big to fit in the defined
    cell size? What if the user makes use of a different size of text than
    you do?


    --
    AGw.
     
    frederick, Apr 24, 2006
    #3
  4. Fabian Vilers wrote:

    > I need to draw a table with fixed size (height + width) cells. In any
    > case, the text should never expand the size of the cell.


    Reanalyze the original problem, and you'll probably notice that you
    don't need to create such problems.

    If you insist on creating a problem with fixed-size cells, set the
    height and width of each cell in CSS _and_ set
    table-layout: fixed
    for the table. Additionally, set the overflow property for the cells;
    the value depends on whether you wish to have content hidden or let it
    overflow outside the cell or have scroll bars in a cell.
     
    Jukka K. Korpela, Apr 24, 2006
    #4
  5. Jukka K. Korpela wrote:
    > Fabian Vilers wrote:


    All of the proposals you made was not correct.

    First I must say the business design of the applications I need to work
    on is really poor. Specifications are these, I must wrap the cell content.

    I finally manage to find the solution by myself.

    The content of the cell is enclosed inside a <div style="height: 123px;
    width: 456px; overflow: hidden">

    Anyway; thanks for your responses.
    Fabian
     
    Fabian Vilers, Apr 24, 2006
    #5
  6. Fabian Vilers

    Paul Watt Guest

    "Fabian Vilers" <> wrote in message
    news:444cdbbb$0$436$...
    > Jukka K. Korpela wrote:
    >> Fabian Vilers wrote:

    >
    > All of the proposals you made was not correct.
    >
    > First I must say the business design of the applications I need to work on
    > is really poor. Specifications are these, I must wrap the cell content.
    >
    > I finally manage to find the solution by myself.
    >
    > The content of the cell is enclosed inside a <div style="height: 123px;
    > width: 456px; overflow: hidden">
    >

    If you re-read Jukka's post he said to do that
     
    Paul Watt, Apr 24, 2006
    #6
  7. Paul Watt wrote:

    >>The content of the cell is enclosed inside a <div style="height: 123px;
    >>width: 456px; overflow: hidden">
    >>

    > If you re-read Jukka's post he said to do that


    Well, something in that direction, in the "If you insist on creating a
    problem" part, but I surely did not suggest creating additional problems
    by using px dimensions, and I did not suggest using an artificial <div>
    element, or using inline styles.

    If the business design of an application is really poor, it should be
    redesigned. We have no way of knowing whether the OP even tried asking
    whether the original problem could be fixed. (He mentioned that he "must
    wrap the cell content", which is something completely different and
    might indicate that the business design has been misunderstood.)
     
    Jukka K. Korpela, Apr 24, 2006
    #7
  8. On Mon, 24 Apr 2006, Fabian Vilers wrote:

    > I need to draw a table with fixed size (height + width) cells. In any case,
    > the text should never expand the size of the cell.


    In case it wasn't already obvious, HTML has no way to work around a
    fundamentally misconceived requirement.

    > Any help is appreciated,


    To get a usable result, first redefine the user requirement. No real
    user would really demand that the required text should fail to fit in
    its cell - and that's what you just asked for. Ergo, whoever
    specified this requirement is not representative of a user. The next
    step is yours, I guess.
     
    Alan J. Flavell, Apr 24, 2006
    #8
  9. Fabian Vilers

    Neredbojias Guest

    To further the education of mankind, Fabian Vilers
    <> vouchsafed:

    >> Fabian Vilers wrote:

    >
    > All of the proposals you made was not correct.
    >
    > First I must say the business design of the applications I need to
    > work on is really poor. Specifications are these, I must wrap the cell
    > content.
    >
    > I finally manage to find the solution by myself.
    >
    > The content of the cell is enclosed inside a <div style="height:
    > 123px; width: 456px; overflow: hidden">


    You must wrap the cell content and hide the overflow? -With all users'
    varying text-sizes, etc., to deal with? Okay...

    --
    Neredbojias
    Infinity has its limits.
     
    Neredbojias, Apr 24, 2006
    #9
  10. Neredbojias wrote:
    > You must wrap the cell content and hide the overflow? -With all users'
    > varying text-sizes, etc., to deal with? Okay...
    >


    I know this sucks
     
    Fabian Vilers, Apr 25, 2006
    #10
  11. Fabian Vilers

    stochmind

    Joined:
    Aug 21, 2007
    Messages:
    1
    Either Jukka is extremely new to the game, or plain incompetent. Anyone with a bit of real life experience knows that just because a standard is set out to handle most scenarios, there will ALWAYS be real life cases where it's not sufficient. Coming up with a scenario where you have an independent system where a html based interface needs to trunkate text in table cells is not a hard task for anyones imagination.

    Just the fact that he suggests to "redesign the business design" is proof that he probably hasn't worked very much in larger real world web applications: The person who deals with HTML tables is often very far away from the person who develops business logic.
     
    stochmind, Aug 21, 2007
    #11
  12. Fabian Vilers

    Rex the Strange

    Joined:
    Mar 11, 2009
    Messages:
    1
    Here here! I'm also looking for a solution to this same problem. A little tip for those of you who feel the need to say things like "why do you want to do that!?" - that's not particularly helpful and I'm sure the author has his reasons for wanting to do what he wants to do.

    Why do I want to do it? Quite frankly, none of your damn business. If you don't know the answer then you might consider not responding rather than proving what a complete, self-righteous, holier-than-thou a-hole you are.
     
    Rex the Strange, Aug 19, 2009
    #12
    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. Replies:
    11
    Views:
    1,093
    Toby Inkster
    Jan 28, 2005
  2. johnp
    Replies:
    4
    Views:
    3,676
    Toby Inkster
    May 23, 2005
  3. ssk
    Replies:
    5
    Views:
    5,521
    Jukka K. Korpela
    Oct 30, 2006
  4. Replies:
    1
    Views:
    742
    Beauregard T. Shagnasty
    Dec 29, 2007
  5. RMZ
    Replies:
    2
    Views:
    192
    David Mark
    Aug 2, 2007
Loading...

Share This Page