|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> Or use a 55px wide clear gif and don't tell anyone.
I was thinking of doing just that -- in the unused bottom row. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 2008-03-31, dorayme <doraymeRidThis@optusnet.com.au> wrote:
> In article ><9b45905a-7e68-4b3c-a39f-41cef459ed20@b64g2000hsa.googlegroups.com>, > ilya2@rcn.com 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 > . 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. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Scripsit ilya2@rcn.com:
> I am making an HTML table. It has a lot of columns with fixed width > (55 pixels). Why? Do they all contain images? And how many lots of such columns do you expect to fit into a fairly reasonably 400 or 500 pixels wide window? On the other hand, for all that you can know, 55 pixels might not be enough for a single character. Post the URL, and maybe someone can suggest a way to redesign the table. It probably needs a redesign, or more. -- Jukka K. Korpela ("Yucca") http://www.cs.tut.fi/~jkorpela/ |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
ilya2@rcn.com 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 > You can use <td nowrap>word1 word2<br>word3</td> or <td><nobr>word1 word2<br>word3</nobr></td> -- Petr Vileta, Czech republic (My server rejects all messages from Yahoo and Hotmail. Send me your mail from another non-spammer site please.) Please reply to <petr AT practisoft DOT cz> |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Mar 31, 5:31pm, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:
> Scripsit il...@rcn.com: > > > I am making an HTML table. It has a lot of columns with fixed width > > (55 pixels). > > Why? Do they all contain images? And how many lots of such columns do > you expect to fit into a fairly reasonably 400 or 500 pixels wide > window? I do not expect it to fit on a 400 to 500 pixels wide window. > On the other hand, for all that you can know, 55 pixels might not be > enough for a single character. > > Post the URL, and maybe someone can suggest a way to redesign the table. > It probably needs a redesign, or more. Here it is: http://users.rcn.com/ilya187/TimeGraph.html |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On 2008-04-01, dorayme <doraymeRidThis@optusnet.com.au> wrote:
> In article <slrnfv2jve.hn7.spamspam@bowser.marioworld>, > Ben C <spamspam@spam.eggs> wrote: > >> On 2008-03-31, dorayme <doraymeRidThis@optusnet.com.au> wrote: > >> > Everything depends on the details of your project, perhaps a url might >> > . 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. >> >> [...] > > Safari 2 is different to Firefox in the effects. > > A table with td {border: 1px solid; width: 200px;} behaves differently > in different browsers to td {border: 1px solid; min-width: 200px;} Yes, width and min-width are different. Firefox seems to think that min-width doesn't apply to table cells at all from what I can see. But width on a table-cell is a minimum width (in the ordinary language sense) because you only get the width you asked for if it's >= the minimum content width. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On 2008-04-01, dorayme <doraymeRidThis@optusnet.com.au> wrote:
> In article <slrnfv5906.lu.spamspam@bowser.marioworld>, > Ben C <spamspam@spam.eggs> wrote: > >> On 2008-04-01, dorayme <doraymeRidThis@optusnet.com.au> wrote: >> > In article <slrnfv2jve.hn7.spamspam@bowser.marioworld>, >> > Ben C <spamspam@spam.eggs> wrote: >> > >> >> On 2008-03-31, dorayme <doraymeRidThis@optusnet.com.au> wrote: >> >... >> >> > td {border: 1px solid; min-width: 20em;} >> >> >> >> Width on table cells kind of means minimum width anyway. >> >> >> >> [...] >> > >> > Safari 2 is different to Firefox in the effects. >> > >> > A table with td {border: 1px solid; width: 200px;} behaves differently >> > in different browsers to td {border: 1px solid; min-width: 200px;} >> >> Yes, width and min-width are different. >> >> Firefox seems to think that min-width doesn't apply to table cells at >> all from what I can see. > > True, with FF, one can save one's breath for all the notice it takes of > this in a table. Min-width on table-cells does fall through the cracks a bit. The spec doesn't say it doesn't apply to them, but in the bit that tells you what to do with min-width (10.4), it refers you back to "Calculating widths and Margins 10.3" which explains everything except tables and table cells. And you obviously can't just blindly apply the rules in 10.4 to table cells since all cells in a column have to have the same width. |
|
![]() |
| Outils de la discussion | |
|
|