Click to See Complete Forum and Search --> : table width problem
simon_gill
03-14-2003, 09:39 AM
I have a table that I want to fit entirely across the page horizontally, without any gaps at all, but no matter what i do, there is always about a 10pixel gap on the right side.
the file is here: http://local.live.com.au/yak_test/another_test.htm
the gap on the right must disappear.
And my code:
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY bgcolor=white scroll=no>
<div style="position: absolute; top: 40%; left: 0px; right: 0px;">
<table border=1 width=100% bgcolor=F85800 cellpadding=0 cellspacing=0>
<tr><td>
<OBJECT>
-SWF code is here on the normal file!
</OBJECT>
</td></tr>
</table>
</div>
</BODY>
</HTML>
gil davis
03-14-2003, 10:20 AM
<HTML>
<HEAD>
<TITLE></TITLE>
<style type="text/css">
BODY {margin: 0pt; border-width: 0pt; background-color: white; overflow: hidden}
</style>
</HEAD>
<BODY>
<div style="position: absolute; top: 40%; left: 0px;"><!-- right: 0px;"-->
<table border=1 width=100% bgcolor=F85800 cellpadding=0 cellspacing=0>
<tr><td>
<!--OBJECT>
-SWF code is here on the normal file!
</OBJECT-->
</td></tr>
</table>
</div>
</BODY>
</HTML>
nkaisare
03-14-2003, 01:49 PM
Why do you need the table? Its unnecessary.
simon_gill
03-14-2003, 09:19 PM
I have the table because I need the background color either side of the flash object, but not above or below it.
I dont know much about CSS, so I used a table.
nkaisare
03-15-2003, 12:37 PM
You can use the following:
body {margin: 40% 0 auto 0; background: #F85800}
This will give top margin of 40% (using this instead of div positioned 40% from top), and the background will span the entire width of the page.
simon_gill
03-15-2003, 10:28 PM
thanks for that. So do I just take out any table and the div style, and replace it with that code for the body tag?
Ive plugged around a bit and cant get it working.
Would the body tag read:
<BODY {margin: 40% 0 auto 0; background: #F85800} >
And then whatever code below will stay within that boundary?
nkaisare
03-16-2003, 12:06 PM
<BODY {margin: 40% 0 auto 0; background: #F85800} >
No.
Use either
<body style="margin: 40% 0 auto 0; background: #F85800">
or
<head>
<style type="text/css">
body {margin: 40% 0 auto 0; background: #F85800}
</style>
</head>
<body>
Since you used <div style="..."> in your original program, I presumed you'd know a little bit about CSS. Anyway, you can read about that at http://www.w3schools.com
simon_gill
03-16-2003, 05:11 PM
ok thanks again, but the desired effect still isnt happening.
I want the orange background only to be either side of the flash object, but not above or below it. Above or below must be white.
I have postd file again with your recommended changes at:
http://local.live.com.au/yak_test/another_test.htm
Thanks again!