tags:

views:

683

answers:

3

I have two HTML tables which would ideally be placed side by side on the screen. Widescreen monitors will cope with this fine, but the tables are too wide to be side by side on most old-fashioned monitors. So I want to use css (or even just HTML, if possible) to place the tables side by side only if the resolution is high enough.

This works automatically with images, usually, but is there a way to do it for tables?

Thanks,

Ben

+8  A: 

Yes, apply the CSS style float:left to the table elements

Here is an excellent primer on floating: http://css.maxdesign.com.au/floatutorial/

Paul Dixon
+2  A: 

My advice would be to float the table (remember to specify a table width - choose one that's full on a non-widescreen monitor).

table {
    width: 500px; /* important */
    float: left;
}

However this might work too (untested):

table {
    display: inline;
}
Ross
Tables have their own display, so changing to inline isn't the answer - the float is certainly correct though.
Steve Perks
A: 
Schwartser