468,170 Members | 1,905 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,170 developers. It's quick & easy.

How to use position:relative?

I'm getting some funny behavior in IE (fine in FF and Opera) with a table
(logtable) that is supposed to be 1000px wide within a div (log) that is
supposed to be 100% of it's parent container (stats) which is supposed to have
8% margin right and left.

What is happening is that the 8% margin on the right is being ignored. But as
soon as you try to resize your browser window (even the slightest adjustment)
the margin snaps to the correct dimension. Any suggestions? I'm wondering if
I'm using position:relative correctly, or have missed something else...

Here is the CSS (sorry, no link...)

body {
margin:0 0 0 0;
font-size:14px;
font-family:Arial, Helvetica, sans-serif;
}

#stats {
margin:0 8% 0 8%;
padding-bottom:30px;
}

#log {
position:relative;
top:0;
width:100%;
height:320px;
overflow:scroll;
margin-bottom:5px;
line-height:13px;
}

#logtable {
font-size:12px;
width:1000px;
border:0;
}

The table is dynamically generated like this:

<table id="logtable" cellspacing="1">
<colgroup>
<col width="180">
<col width="120">
<col width="150">
<col width="100">
<col width="150">
<col width="250">
</colgroup>
<tr>
<th align="left">Column 1</th>
<th align="left">Column 2</th>
<th align="left">Column 3</th>
<th align="left">Column 4</th>
<th align="left">Column 5</th>
<th align="left">Column 6</th>
</tr<?php
for ($i = 0; $i < $log_data; $i++)
{
$line = explode( "|", $data[$i] ); ?>
<tr>
<td align="left"><?php echo $line[0]; ?></td>
<td align="left"><?php echo $line[1]; ?></td>
<td align="left"><?php echo $line[2]; ?></td>
<td align="left"><?php echo $line[3]; ?></td>
<td align="left"><?php echo $line[4]; ?></td>
<td align="left"><?php echo $line[5]; ?></td>
</tr<?php
} ?>
</table>

Sep 8 '06 #1
2 1467

Did you try page in FireFox?
--
Kevin31

'Barcode software windows' (http://www.barcodeformac.com) - 'Training
Courses at UK Virtual College' (http://www.ukvirtual-college.co.uk)
------------------------------------------------------------------------
Kevin31's Profile: http://www.highdots.com/forums/m139
View this thread: http://www.highdots.com/forums/t188534

Sep 8 '06 #2
On Fri, 8 Sep 2006 08:00:51 -0700, "deko" <de**@nospam.comwrote:
>I'm getting some funny behavior in IE (fine in FF and Opera) with a table
(logtable) that is supposed to be 1000px wide within a div (log) that is
supposed to be 100% of it's parent container (stats) which is supposed to have
8% margin right and left.
Well, you define styles 'stats' and 'log' which are nowhere used, so I'm
not surprised you have problems.

You are also trying to make everything a rigid pixel-exact layout, which
is a thoroughly bad idea as explained many times here. See e.g.
http://www.xs4all.nl/~sbpoley/webmat...lexdesign.html and
http://www.xs4all.nl/~sbpoley/webmatters/fontsize.html
--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Sep 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by glutinous | last post: by
3 posts views Thread by Markus Ernst | last post: by
2 posts views Thread by Martin Geisler | last post: by
6 posts views Thread by Gérard Talbot | last post: by
3 posts views Thread by rsrimantula | last post: by
10 posts views Thread by Mark | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.