Based on your comment from my other answer you are left with having to code. I have solved this sort of problem in the past by using a shim column. I wouldn't call it elegant but it did the trick. Basically, you have an extra column in your header at the end that acts as a shim for the scrollbar. When the scrollbar is being displayed then the shim column is displayed with the exact width of the scrollbar. When there is no scrollbar you hide the shim.
Setup your layout with the additional column. Style it however you want. I usually make it so it blends in with the adjoining column so the user doesn't see a little square when it is being displayed.
Add all your data rows to the content table as you normally would. Make sure the content table and all its tr/td are added to the DOM.
Once the data is added then test whether the scrollbar is visible. You can do this by checking if the scroll height is greater then the offset height.
ScrollPanel scrollPanel; Element scrollElem = scrollPanel.getElement(); if (scrollElem.getScrollHeight() > scrollElem.getOffsetHeight()) { // scrollbar is visible }
If the scrollbar is displayed then show your shim column, otherwise hide it.
if (scrollElem.getScrollHeight() > scrollElem.getOffsetHeight()) { // scrollbar is visible - show shim column shimColumnTD.getStyle().setDisplay(Display.BLOCK); } else { // scrollbar not visible - hide shim column shimColumnTD.getStyle().setDisplay(Display.NONE); }
Determine the width of the shim column so that it matches the width of the scrollbar. If you go look inside the below method you can see how it does this.
// calculate the width of the scrollbar for the given browser int shimWidth = AbstractNativeScrollbar.getNativeScrollbarWidth();
Obviously, this is just all pseudo but it should lead you in the right direction. Good luck...