Re: How do I keep apparent table width independent of window size?



On 2008-03-31, dorayme <doraymeRidThis@xxxxxxxxxxxxxxx> wrote:
In article
<9b45905a-7e68-4b3c-a39f-41cef459ed20@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
ilya2@xxxxxxx wrote:

I am making an HTML table. It has a lot of columns with fixed width
(55 pixels). If I view it on full-screen IE window, the table fits on
the screen and looks just as I want it to look. When I make the window
smaller than the table, I expect horizontal scroll bar to appear.
Instead each column shrinks; a cell which had:

word1 word2
word3

becomes:

word1
word2
word3

thus distorting the table and making it look ugly. Only when I make
the window so small that columns can not shrink any more (each is the
longest word wide), does horizontal scroll bar appear.

How can I avoid this -- keep the columns same width regardless of
window size? I already tried giving the table a fixed width -- it does
not solve the problem, if anything makes it worse.

If you fix width all the cells and all the same and in pixels, you do
run into all sorts of problems; what would you want to happen, for
example, if the user upped his text size, where is the text to go if it
cannot fit?

Unless you use table-layout: fixed, it will fit, no matter how narrow
the cells are made.

Everything depends on the details of your project, perhaps a url might
help. But perhaps this will give you a thought to play with: Don't
bother with giving the table itself a width, try min-width in em for
either all the cells or selected cells (by classing them is most
reliable). Choose a size to fit the point below which text will wrap to
your displeasure:

td {border: 1px solid; min-width: 20em;}

Width on table cells kind of means minimum width anyway.

[...]
Or use a 55px wide clear gif and don't tell anyone.

I'm surprised setting a width on the whole table didn't work as intended
but then the OP is talking about IE where anything goes.
.



Relevant Pages

  • Re: How do I keep apparent table width independent of window size?
    ... If I view it on full-screen IE window, ... If you fix width all the cells and all the same and in pixels, ... Choose a size to fit the point below which text will wrap to ...
    (comp.infosystems.www.authoring.html)
  • Re: space
    ... I have a 17" screen, 1440x900 pixels and the browser open full screen, and it still doesn't ft. ... Most people prefer no wider than 760 pixels, to fit an 800 pixel wide window. ... it is due to mismatched table cells and rows and a height attribute: ... On 5/23/2009 6:12 PM, William. ...
    (microsoft.public.frontpage.client)
  • Re: help please
    ... As far as the OP is concerned, pixels were deprecated as soon as his ... It should change to fit the window. ... you'd have to scroll to see wrapped content anyway. ...
    (alt.html)
  • Re: How do I keep apparent table width independent of window size?
    ... you expect to fit into a fairly reasonably 400 or 500 pixels wide ... I do not expect it to fit on a 400 to 500 pixels wide window. ... and maybe someone can suggest a way to redesign the table. ...
    (comp.infosystems.www.authoring.html)
  • Re: tab characters in news
    ... > about two screen's worth, ... fit on a single sheet of paper, it was too long and had to be ... and vim in a tall "command prompt" window on ... These days, for example, if a C function call doesn't fit ...
    (comp.programming)

Loading