Try this:
table#my_table {
max-width:500px;
width:expression(document.body.clientWidth > 500? "500px": "auto" );
}
Unfortunately this won't validate due to the ?
. The good news is since it's an IE-only solution you can simply do conditional elements when you create your
tag and setup IE-specific classes:
Now in your CSS:
table#my_table {
width:500px;
max-width:500px;
}
.ie7 table#my_table {
width:expression(document.body.clientWidth > 500? "500px": "auto" );
}