Reputation: 26868
How to CSS style a table such that
its width is at the most 80% of page width, and,
is at the least 50% of the page width, and
is as wide as necessary?
Upvotes: 1
Views: 143
Reputation: 7671
I think you want both min-width
and max-width
:
<style type="text/css">
table
{
min-width: 50%;
max-width: 80%;
}
</style>
This will make the table at least 50% the width of its container. It will grow (if it needs) to a maximum of 80% width of the page.
Upvotes: 1