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:
      overflow-y: scroll;
      border-color: #AEB1AD;
      border-style: solid;
      border-width: 1px;
<div class="scrollbox" style="width:xpx;height:ypx">
<table width="100%">

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.

Who is Participating?
You can force the scrollbar to always be on and set the widths based on that...

I would use javascript.
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.
dchellAuthor Commented:
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.
dchellAuthor Commented:
Looks like it will have to be javascript then
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.