I can't position these 4 tables in 2 rows

Hello guys,

I really tried everything and I can’t make it work in all browsers.

So I have 4 tables that are fetched from mysql database, this is one piece of code for 1 table:



[I]include config.php etc etc[/I]

echo "<div id='newest-table' style='position:absolute; top:400; left:10;'><table class='sample'>
<h2 style='position:relative; left:40px;'>Newest servers</h2>
<tr>
<th>Proxy Server</th>
<th>Port</th>
</tr></div>";

As you can see using styling css and absolute:position-ning i tried to position these 4 tables into something like this:

I can make it work in major browsers like firefox and chrome, but its not compatible with internet explorer, opera, other browsers and its not compatible with resoultions under 1024x768 or some bigger resolutions…

For example in internet explorer i got this:

or even worse… as you can see everything is totally ****** up :frowning:

Can you somehow help me position these tables or point me to some resources!
If someone would like to help me on MSN or skype, im ready to pay in some symbolic value.

Thanks!

Make a parent div have with double of one table. I think it should work. :slight_smile:

Hm… interesting idea but i don’t know how to implement it since its in php and it fetch from mysql hm…

Can I somehow wrap it with padding 10px ?

but how to wrap it?

Could you give more detail about your php code?

Here is the whole code (its so big :S )

&lt;?php

include("config.php");

    $mysql = mysql_connect($dbHost, $dbUser, $dbPass);
    if (!$mysql)
        exit;
    if (!mysql_select_db($dbDatabase, $mysql))
        exit;

//$result = mysql_query("SELECT * FROM `hitlog`");


if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 

$start_from = ($page-1) * 15; 
$sql = "SELECT * FROM `hitlog` ORDER BY `proxy` ASC LIMIT $start_from, $logs";
$result = mysql_query ($sql); 



echo "&lt;div id='fastest-table' style='position:absolute; top:250; left:360; display:inline;'&gt;&lt;table class='sample'&gt;
&lt;h2&gt;&lt;center&gt;Fastest proxy servers&lt;/center&gt;&lt;/h2&gt;
&lt;tr&gt;
&lt;th&gt;Proxy Server&lt;/th&gt;
&lt;th&gt;port&lt;/th&gt;
&lt;/tr&gt;&lt;/div&gt;";


while($row = mysql_fetch_array($result))
  {
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;&lt;a class='tablelinks' target='_blank' href='http://" .$row['proxy'] . "'&gt;".$row['proxy']."&lt;/a&gt;&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['port'] . "&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
echo "&lt;/table&gt;";



$result = mysql_query("SELECT COUNT(proxy) FROM `$tablename`");
$row = mysql_fetch_row($result);
$total_records = $row[0];
$total_pages = ceil($total_records / $logs);

if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 

$start_from = ($page-1) * 15; 
$sql = "SELECT * FROM `us` ORDER BY `proxy` ASC LIMIT $start_from, $logs";
$result = mysql_query ($sql); 



echo "&lt;div id='us-table' style='position:absolute; top:400; left:0; display:inline;'&gt;&lt;table class='sample'&gt;
&lt;h2&gt;&lt;center&gt;Non-USA proxy servers&lt;/center&gt;&lt;/h2&gt;
&lt;tr&gt;
&lt;th&gt;Proxy Server&lt;/th&gt;
&lt;th&gt;port&lt;/th&gt;
&lt;/tr&gt;&lt;/div&gt;";

while($row = mysql_fetch_array($result))
  {
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;&lt;a class='tablelinks' target='_blank' href='http://" .$row['proxy'] . "'&gt;".$row['proxy']."&lt;/a&gt;&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['port'] . "&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
echo "&lt;/table&gt;";



$result = mysql_query("SELECT COUNT(proxy) FROM `us`");
$row = mysql_fetch_row($result);
$total_records = $row[0];
$total_pages = ceil($total_records / $logs);



if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 

$start_from = ($page-1) * 15; 
$sql = "SELECT * FROM `nonus` ORDER BY `proxy` ASC LIMIT $start_from, $logs";
$result = mysql_query ($sql); 



echo "&lt;div id='nonus-table' style='position:absolute; top:0; left:347;'&gt;&lt;table class='sample'&gt;
&lt;h2&gt;&lt;center&gt;USA proxy servers&lt;/center&gt;&lt;/h2&gt;
&lt;tr&gt;
&lt;th&gt;Proxy Server&lt;/th&gt;
&lt;th&gt;port&lt;/th&gt;
&lt;/tr&gt;&lt;/div&gt;";

while($row = mysql_fetch_array($result))
  {
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;&lt;a class='tablelinks' target='_blank' href='http://" .$row['proxy'] . "'&gt;".$row['proxy']."&lt;/a&gt;&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['port'] . "&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
echo "&lt;/table&gt;";



$result = mysql_query("SELECT COUNT(proxy) FROM `nonus`");
$row = mysql_fetch_row($result);
$total_records = $row[0];
$total_pages = ceil($total_records / $logs);



if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 

$start_from = ($page-1) * 15; 
$sql = "SELECT * FROM `newest` ORDER BY `proxy` ASC LIMIT $start_from, $logs";
$result = mysql_query ($sql); 



echo "&lt;div id='newest-table' style='position:absolute; top:-400; left:0;'&gt;&lt;table class='sample'&gt;
&lt;h2 style='position:relative; left:40px;'&gt;Newest proxy servers&lt;/h2&gt;
&lt;tr&gt;
&lt;th&gt;Proxy Server&lt;/th&gt;
&lt;th&gt;port&lt;/th&gt;
&lt;/tr&gt;&lt;/div&gt;";

while($row = mysql_fetch_array($result))
  {
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;&lt;a class='tablelinks' target='_blank' href='http://" .$row['proxy'] . "'&gt;".$row['proxy']."&lt;/a&gt;&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['port'] . "&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
echo "&lt;/table&gt;";



$result = mysql_query("SELECT COUNT(proxy) FROM `nonus`");
$row = mysql_fetch_row($result);
$total_records = $row[0];
$total_pages = ceil($total_records / $logs);



?&gt; 

But as you can see it fetch data from 4 mysql tables.

First create a web page that exhibits the desired layout, once you have this, then introduce PHP to create the markup.

I agree with this approach.

@arsenalfun: you should try what AnthonySterling said. If you have any further problem, just leave your comment here. :slight_smile:

yeah I know, I just posted php part there is html and css also, but i can’t simply position those tables…


echo "<div id='newest-table' style='position:absolute; top:-400; left:0;'><table class='sample'>
<h2 style='position:relative; left:40px;'>Newest proxy servers</h2>
<tr>
<th>Proxy Server</th>
<th>port</th>
</tr>[COLOR="Red"]</div>[/COLOR]";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td><a class='tablelinks' target='_blank' href='http://" .$row['proxy'] . "'>".$row['proxy']."</a></td>";
  echo "<td>" . $row['port'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

I spy, with my little eye… a tag in the wrong place. 4 times over.

Yes, I think your code should be changed as following:


echo "<div id='newest-table' style='position:absolute; top:-400; left:0;'><table class='sample'>
<h2 style='position:relative; left:40px;'>Newest proxy servers</h2>
<tr>
<th>Proxy Server</th>
<th>port</th>
</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td><a class='tablelinks' target='_blank' href='http://" .$row['proxy'] . "'>".$row['proxy']."</a></td>";
  echo "<td>" . $row['port'] . "</td>";
  echo "</tr>";
  }
echo "</table>[COLOR="Red"]</div>[/COLOR]";

Hmm… interesting catch, I will take a look, thanks!