By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,321 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

How to use position:relative?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

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

P: n/a
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.