以PHP为中心导致div标记

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 :

#results div table
{
    margin:auto;
}

Tables are block elements. Centre them with

table {
    margin: auto;
}

in the stylesheet. Since they shrink wrap their content by default, you don't need to give them an explicit width.

The W3C have an introduction to CSS if you need it.

See also, centring using CSS for a more detailed explanation of the above.

use style="margin:0 auto;width:smaller than container tag of the html" as a Inline css hope this will help

other wise you can use this class on the parent div tag

.a-center
{
   text-align:center;
}

Instead of using align="center", you should use style="margin: 0 auto; with: 960px". Note, that your width may differ. I have used 960px as an example only.