Solved

Table, 100% Width, flush with both margins:

Posted on 2000-03-08
5
150 Views
Last Modified: 2010-04-09
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
0
Comment
Question by:kisrael
  • 2
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
mblase earned 50 total points
ID: 2596664
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
 

Expert Comment

by:morbiusx
ID: 2598965
insted of using %'s try to use pixels.
0
 

Author Comment

by:kisrael
ID: 2599134
Well, the idea is they want it stretched fully accross with no gaps, but they don't control how wide the screen is.
0
 

Expert Comment

by:morbiusx
ID: 2600024
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
 

Author Comment

by:kisrael
ID: 2601607
Ehh, javascript might get a little futzy. I think we might experiment with the background image idea, or just live with it. Thanks.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now