I’m learning PHP and I have made a results table that sits within a div, however the PHP results automatically appear on the left hand side of the div, probably the default. I was wondering if there is a way in which it can be set for the resuts table to appear in the middle of the div without having to do it by declaring the px’s for each column?…my code for the div is below..
<div class="results" align="center">
<div><?php
$rfp = $_GET['cid'];
// Connects to Database
mysql_connect("localhost", "root") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());
$data = mysql_query("SELECT rfp_id, issue_date, rfp_status.status FROM company, rfp, rfp_status WHERE company.company_id = rfp.company_id AND rfp_status.status_id = rfp.status_id AND company.company_id = '$rfp'")
or die(mysql_error());
echo "<table border=0 cellpadding=15>";
echo "<tr align = center bgcolor=white>
<td><b>RFP ID</b></td><td><b>Date Added</b></td><td><b>Status</b></td>" ;
while($row = mysql_fetch_array($data)){
$rid = $row['rfp_id']; //if you have the column names, replace 0 with 'column_name'
$idate = $row['issue_date'];
$status = $row['status'];
# inserts value into table as a hyperlink
echo "<tr align = center bgcolor=white><td>$rid</td><td><b><a target='_blank' href=view_section_detail.php?rid=$rid>$idate</a></b></td><td>$status</td>";
}
# displays table
print '</table>';
?></div>
Any help or advice would be appreciated…
Thanks
I’d try this :