Chatroom
 

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Bad Astronomy and Universe Today Forum > General > Off-Topic Babbling
Register FAQ Members List Calendar Mark Forums Read

   

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 31-March-2008, 01:25 PM
Ilya's Avatar
Ilya Ilya is online now
Senior Member
 
Join Date: Nov 2001
Location: Boston
Posts: 3,111
Default HTML table question

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:

Quote:
word1 word2
word3
becomes:

Quote:
word1
word2
word3
thus distorting the table and making it look ugly. Only when I make 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.
__________________
Fiction has to be plausible. Reality is under no such constraint.
Reply With Quote
  #2 (permalink)  
Old 31-March-2008, 04:13 PM
Nick Theodorakis Nick Theodorakis is offline
Senior Member
 
Join Date: Oct 2007
Posts: 269
Default

I have to wait until I get home to play around, but in the meantime: how are you setting the width? Are you doing it in HTML on the TD or COL elements, or setting the with CSS? As far as I remember, browsers may treat table cell widths in HTML as suggestions, and adjust to fit the content accordingly.

If you are not already, you may want to take a look as using CSS to format tables; perhaps some combination of setting the table cell width to 55 px and using the "overflow" property is what you need.

Nick
__________________
Nick Theodorakis
Reply With Quote
  #3 (permalink)  
Old 31-March-2008, 04:53 PM
Ilya's Avatar
Ilya Ilya is online now
Senior Member
 
Join Date: Nov 2001
Location: Boston
Posts: 3,111
Default

Quote:
Originally Posted by Nick Theodorakis View Post
I have to wait until I get home to play around, but in the meantime: how are you setting the width? Are you doing it in HTML on the TD or COL elements, or setting the with CSS?
I am (so far) setting it in TD tags.
Quote:
As far as I remember, browsers may treat table cell widths in HTML as suggestions, and adjust to fit the content accordingly.
Evidently!
Quote:
If you are not already, you may want to take a look as using CSS to format tables; perhaps some combination of setting the table cell width to 55 px and using the "overflow" property is what you need.

Nick
Thanks, I will take a look at it.
__________________
Fiction has to be plausible. Reality is under no such constraint.
Reply With Quote
  #4 (permalink)  
Old 31-March-2008, 06:34 PM
Nick Theodorakis Nick Theodorakis is offline
Senior Member
 
Join Date: Oct 2007
Posts: 269
Default

Here is an example for you with the cells 55px wide; no overflow property is set. The cells stay the same width, but no scrollbar appears and the table just goes off the edge of the screen when you shrink the viewport.

Nick
__________________
Nick Theodorakis
Reply With Quote
  #5 (permalink)  
Old 01-April-2008, 10:06 AM
Tog_'s Avatar
Tog_ Tog_ is offline
Senior Member
 
Join Date: Oct 2005
Location: Northern Utah
Posts: 3,030
Default

I got a scroll bar in both FireFox and IE7.
__________________
I'm not evil.
An evil person would do the things I think up.
Reply With Quote
  #6 (permalink)  
Old 01-April-2008, 01:09 PM
Ilya's Avatar
Ilya Ilya is online now
Senior Member
 
Join Date: Nov 2001
Location: Boston
Posts: 3,111
Default

Quote:
Originally Posted by Tog_ View Post
I got a scroll bar in both FireFox and IE7.
On which website?
__________________
Fiction has to be plausible. Reality is under no such constraint.
Reply With Quote
  #7 (permalink)  
Old 01-April-2008, 01:36 PM
Tog_'s Avatar
Tog_ Tog_ is offline
Senior Member
 
Join Date: Oct 2005
Location: Northern Utah
Posts: 3,030
Default

Quote:
Originally Posted by Ilya View Post
On which website?
On the one linked by Nick in the post above my previous one.
__________________
I'm not evil.
An evil person would do the things I think up.
Reply With Quote
  #8 (permalink)  
Old 01-April-2008, 02:24 PM
Nick Theodorakis Nick Theodorakis is offline
Senior Member
 
Join Date: Oct 2007
Posts: 269
Default

Quote:
Originally Posted by Tog_ View Post
On the one linked by Nick in the post above my previous one.
Sorry, I meant to say that my observation was made on IE6. I forgot to look at home where I have better browsers.

Nick
__________________
Nick Theodorakis
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browsers, email programs, & HTML editors Delvo Off-Topic Babbling 3 02-February-2008 07:58 PM
More from Arp et al. antoniseb Against the Mainstream 2889 06-March-2007 10:21 AM
Another Hypothetical Question ZachSchuster Questions and Answers 8 23-February-2007 03:55 AM
Sagnac experiment question Jeff Root Questions and Answers 8 20-December-2006 12:24 AM
Apollo tracking stations - very specific amplifier question Nicolas Space Exploration 17 20-March-2006 09:28 PM


All times are GMT. The time now is 02:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
©  2006 Bad Astronomy and Universe Today