Re: How do I keep apparent table width independent of window size?
- From: Ben C <spamspam@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 15:56:00 -0500
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.
.
- References:
- Prev by Date: Re: How do I keep apparent table width independent of window size?
- Previous by thread: Re: How do I keep apparent table width independent of window size?
- Next by thread: Issue with flash objects hover menu as a link
- Index(es):
Relevant Pages
|
Loading