dchell
asked on
Table width of 100% excludes scrollbar under XHTML 1.0
When using
I have an intranet application that is only required to work for IE.
There scrolling tables inside a divs as follows:
<style>
.scollbox
{
overflow-y: scroll;
border-color: #AEB1AD;
border-style: solid;
border-width: 1px;
}
</style>
<div class="scrollbox" style="width:xpx;height:yp x">
<table width="100%">
.
.
.
</table>
</div>
When I use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
it all looks good
but when I use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >
A horizontal scroll bar appears to account for the with of the vertical scrollbar which is now no longer accounted for the the 100% width of the table.
I need to use XHTML 1.0 for other reasons.
My Question is: is there a tidy way to make the width of the table exactly fit its parent div INCLUDING the width of the vertical scroll bar under XHTML 1.0.
Thanks
I have an intranet application that is only required to work for IE.
There scrolling tables inside a divs as follows:
<style>
.scollbox
{
overflow-y: scroll;
border-color: #AEB1AD;
border-style: solid;
border-width: 1px;
}
</style>
<div class="scrollbox" style="width:xpx;height:yp
<table width="100%">
.
.
.
</table>
</div>
When I use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
it all looks good
but when I use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >
A horizontal scroll bar appears to account for the with of the vertical scrollbar which is now no longer accounted for the the 100% width of the table.
I need to use XHTML 1.0 for other reasons.
My Question is: is there a tidy way to make the width of the table exactly fit its parent div INCLUDING the width of the vertical scroll bar under XHTML 1.0.
Thanks
I can't think of anyway to do that short of assuming the scroll bar will always be there and setting the width based on that.
ASKER
I'm happy to have the scrollbar mermanently in place, But the outer div must stretch to the size of the window and the table has to stretch to the size of the div minus the scrollbar width, easy enough to do in javascript, just wondered if there was a cleaner way to do it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looks like it will have to be javascript then