Table, 100% Width, flush with both margins:

I want a table to go across the top of the browser window, to take up the entire thing.

I already have
<BODY topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
 and
<table width="100%" border="0" cellspacing="0" cellpadding="0">
(the table has a background image that I want to extend to the sides of the browser.)
The trouble is, 100% doesn't do the trick, it needs to be 101 or 102, but  then there's a risk of  horizontal scrollbar- at 100, it there's a largeish visible gap at the right side

If I can't get this, I might use a background image for the whole page, but that's a last resort
kisraelAsked:
Who is Participating?
 
mblaseConnect With a Mentor Commented:
Netscape always assumes there's a scrollbar on the right side, and leaves room for it. I don't think you can get around this, at least not reliably. (Some creative JS code could do the job, by measuring the inside dimensions of the browser window, but the width of the scrollbar would vary from system to system.)

Do you *know* that the page will never require a vertical scrollbar? If so, then I can look up the JS solution for you. If not, I'd let it go with the largeish visible gap for the few cases when it occurs.
0
 
morbiusxCommented:
insted of using %'s try to use pixels.
0
 
kisraelAuthor Commented:
Well, the idea is they want it stretched fully accross with no gaps, but they don't control how wide the screen is.
0
 
morbiusxCommented:
the best you will get it to fit is set margins at 0 make the table with no border, then strech either 100% or how ever many pixels
0
 
kisraelAuthor Commented:
Ehh, javascript might get a little futzy. I think we might experiment with the background image idea, or just live with it. Thanks.
0
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.