Link to home
Create AccountLog in
Avatar of DS928
DS928Flag for United States of America

asked on

Table Not Aligning On Center

This table is insisiting on aligning to the left, I need it on center.  Maybe you can see what is wrong?

CSS
.beautifulData table {
	width: 710px;
	border-collapse: collapse;
	font-size: 12px;
	font-family: Verdana, Geneva, sans-serif;
	text-align: left;
	border: 1px solid #404046;
	
}
.beautifulData th {
	background-color: #333333;
	border: 1px solid #404046;
	color: white;
	cursor: pointer;
	margin: 0px;
	padding: 3px 8px 3px 3px;
	text-decoration: none;
	font-weight: 900;
	text-align: left;
}
.beautifulData td {
	padding: 5px 3px;
	border-bottom: 1px solid #CCC;
}
.beautifulData .zebra {
	background-color: #EBF4FB;
}
.bdSortDsc, .bdSortAsc, .bdSortNone {
	height: 10px;
	width: 10px;
	float: right;
	position: relative;
	top: 3px;
	left: 5px;
}
.bdSortAsc {
	background-image: url(arrow-down.gif);
}
.bdSortDsc {
	background-image: url(arrow-up.gif);
}
.bdSortNone {
	background-image: none;
}
.beautifulData tfoot td {
	background-color: #FF0000;
	padding-top: 10px;
	padding-bottom: 8px;
}
#bdStatus {
	float: left;
}
#bdPager ul {
	float: right;
	border: 0px;
	margin: 0px;
	padding: 0px;
}
#bdPager  li {
	border: 0px;
	float: left;
	margin: 0px 1px;
	padding: 0px;
	list-style: none;
}
#bdPager a {
	padding: 3px 6px;
	dispaly: block;
	text-decoration: none;
	color: #000;
	border: 1px solid #333;
}
#bdPager .inactive {
	color: #999;
	border-color: #999;
}
#bdPager .active {
	border-color: #000;
	border-width: 2px;
}

Open in new window


Table Code
<div class="beautifulData" id="result">
      <p align="center">
        <?php
			include("config.php");
			if(!$rs=mysql_query("SELECT tblRestaurants.RestName, tblLocations.CityID,tblLocations.AreaID, 	
			tblLocations.CuisineID, tblLocations.RestID, tblRestaurants.RestPage,
			CONCAT(tblLocations.StreetNumber,' ', tblLocations.Street) Address,
			tblLocations.Phone, tblLocations.Price, tblLocations.Rating
			FROM tblRestaurants INNER JOIN tblLocations ON tblRestaurants.RestID = tblLocations.RestID
			WHERE tblLocations.CityID='16'
			AND tblLocations.AreaID='131'
			AND tblLocations.CuisineID='3'
			ORDER BY tblRestaurants.RestName ASC")) {
			echo "Cannot parse query";
			}
			elseif(mysql_num_rows($rs) == 0) {
			echo "No records found";
			}
			else {
			echo "<table id=\"myResults\" table width=\"930\" class=\"beautifuldata\" align=\"Center\" cellspacing=\"0\">\n";
			echo "<thead>\n<tr>";
			echo "<th>PLACE</th>";
			echo "<th>ADDRESS</th>";
			echo "<th>PHONE</th>";
			echo "<th>PRICE</th>";
			echo "<th>RATING</th>";
			echo "</tr>\n</thead>\n";
			while($row = mysql_fetch_array($rs)) {
			echo"<tr>
			<td><strong><a href='$row[RestPage]'>$row[RestName]</a></strong></td>
			<td>$row[Address]</td>
			<td>$row[Phone]</td>
			<td>$row[Price]</td>
			<td>$row[Rating]</td>
			</tr>\n";
			}
			echo "</table><br />\n";
			}
		?>
      </p>
    </div>

Open in new window

Avatar of Gary
Gary
Flag of Ireland image

.beautifulData table {
should be
.beautifulData {


Extra table
echo "<table id=\"myResults\" table width=\"930
Avatar of DS928

ASKER

Thank you. Took the extra table out.  The table did get bigger from 710 to 930 as desired but still on left align.
Can you post the processed html or give a link
Avatar of DS928

ASKER

Here is the Link.

http://www.menuhead.net/Pages/4TheHead.php

Click on Afghan in the first box and New York City in the second box.  Then Click on the Down Arrow.
Looks centered to me, what browser are you using?
Avatar of DS928

ASKER

explorer9....
try this...

http://www.menuhead.net/Pages/5TheHead.php

Afghan  New York City
Remove the width from
.beautifulData {
Avatar of DS928

ASKER

No go, Still hard left.  If I disable the beautiful data script, the table goes on center, but then I loose sorting, page numbers and record counts. it's just a table.

http://www.menuhead.net/Pages/4TheHead.php
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of DS928

ASKER

Thank You! That did it!  Have a look!  Only one other thing perhaps you could help me with.  Select Afghan, New York City

When the records come up, on the footer of the table to the left across from the 1 if you take your mouse and highlight.  You will see the words "Showing 2 Restaurants.  I am trying to make that black, but can't find it in the CSS.  Also you'll notice if you click on the headers the columns sort now.  Thank you, you have been a big help!
#bdStatus
On line 51 of the beautifuldata.css file
Avatar of DS928

ASKER

Got it!  Thank you!
Avatar of DS928

ASKER

Very good at figuring out this problem.