Need some HTML help. Table Widths.

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
I just got done coding about 15-some pages with tables all set at 810px wide.

Now I realize that having an absolute width probably was not a good idea. Is there any way to have an absolute width that can start resizing itself as the browser window grows smaller?

ex.

browser window: 1600px
table: stays at 810px

browser window: 1000px
table: stays at 810px

browser window: 900px
table: stays at 810px

browser window: 800px
table: resizes to 800px

browser window: 500px
table: resizes to 500px
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
While it would be nice if you could specify min/max/desired width for HTML tables (and/or columns), you can't. Part of this is deliberate, as HTML is not really a document formatting language. It's designed to give the client (which may include things like non-visual browsers, or devices with small screens) a lot of flexibility in displaying the information.

If you're displaying text and not images -- is there some particular reason you want to keep the table at 810 pixels maximum width?

Without resorting to scripting -- there are some semi-hacky things you can do with embedded images to enforce minimum widths, but I'm not sure there's anything you can do with maximum widths. I'm not an HTML expert, though.
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
There's min/max width/height properties in CSS. It works on all browsers except for IE, which actually treat height/width as the min height/width.
 

NanoStuff

Banned
Mar 23, 2006
2,981
1
0
Tabular data isn't really one that should be fluid. If you have a significant amount of content per cell to stick into a table, you probably shouldn't be using a table.