Results 1 to 6 of 6

Thread: Div Problems

  1. #1
    Join Date
    Feb 2013
    Posts
    58
    Thanks
    10
    Thanked 1 Time in 1 Post

    Default Div Problems

    I have a page that has a table on it. I want to put either 2 divs or 2 table's under the first table. I tried both. Neither one refuses to go under the first table. They either end up in the middle of the first table or squished on the side. Any help is appreciated. Thank you. The link..
    Menuhead.com
    Baltimore /American/Get Results/Click on name 13.5 then the page opens.

    If requested I'll post the page. But it's long. In any case heres a play around page. If this works then I can go to the real page.

    Code:
    <?php
    include("Scripts/config.php");
    $Lid = $_GET['LocationID']; 
    mysql_query("SET CHARACTER SET utf8");
    $sql=mysql_query("SELECT tblRestaurants.RestName,tblLocations.StreetNumber,tblLocations.Street,
    	tblLocations.CrossOne, tblLocations.CrossTwo, tblCities.CityName,tblStates.StateName,tblZipCodes.ZipCodeName,
    	tblLocations.Phone,tblLocations.Email, tblLocations.Fax, tblLocations.SMS, tblLocations.Website,
    	tblLocations.Rating,tblLocations.Price,tblLocations.Wheelchair,tblLocations.RestPix
    	FROM tblLocations
    	INNER JOIN tblRestaurants ON tblRestaurants.RestID = tblLocations.RestID
    	INNER JOIN tblCities ON tblCities.CityID = tblLocations.CityID
    	INNER JOIN tblStates ON tblStates.StateID = tblLocations.StateID
    	INNER JOIN tblZipCodes ON tblZipCodes.ZipCodeID = tblLocations.ZipCodeID
    	WHERE tblLocations.LocationID = '$Lid'");
    	while($row=mysql_fetch_array($sql))
    	{
    	$RestName = $row['RestName'];
    	$StreetNumber = $row['StreetNumber'];
    	$Street = $row['Street'];
    	$CrossOne = $row['CrossOne'];
    	$CrossTwo = $row['CrossTwo'];
    	$City = $row['CityName'];
    	$State = $row['StateName'];
    	$ZipCode = $row['ZipCodeName'];
    	$Phone = $row['Phone'];
    	$Email = $row['Email'];
    	$Fax = $row['Fax'];
    	$SMS = $row['SMS'];
    	$Website = $row['Website'];
    	$Rating = $row['Rating'];
    	$Price = $row['Price'];
    	$Wheelchair = $row['Wheelchair'];
    	$RestPix = $row['RestPix'];
    	}
    	?>
        <?PHP
    	include("Scripts/config.php");
    	$Lid = $_GET['LocationID']; 
    
    	$sqlHours=mysql_query("SELECT * FROM tblHours
    	WHERE tblHours.LocationID = '$Lid'");
    	while($row=mysql_fetch_array($sqlHours))
    	{
    	$Sun = $row['SunRest'];
    	$Mon = $row['MonRest'];
    	$Tue = $row['TueRest'];
    	$Wed = $row['WedRest'];
    	$Thur = $row['ThurRest'];
    	$Fri = $row['FriRest'];
    	$Sat = $row['SatRest'];
    	}
    	?>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    #container {
    	width: 960px;
    	background-color: #FFF;
    	margin-top: 0;
    	margin-right: auto;
    	margin-bottom: 0;
    	margin-left: auto;
    	height: 2200px;
    	border-right-width: thick;
    	border-left-width: thick;
    	border-right-style: solid;
    	border-left-style: solid;
    	border-right-color: #F00;
    	border-left-color: #F00;
    	
    }
    #layout_top {
    	position:static;
    	width:960px;
    	min-height:300px;
    }
    #heading_bar {
    	position:relative;
    	width:960px;
    	background:#09F;
    	height:20px;
    	padding:6px 0px 6px 0px;	
    }
    #layout_col_left {
    	background:#003366;
    	width:240px;
    	margin:0px 0px 0px 0px;
    	float:left;
    }
    #layout_col_right {
    	width:360px;	
    	float:left;
    }
    #layout_col_farright {
    	background:#C36;
    	width:360px;	
    	float:left;
    }
    
    #layout_bottom {
    	position: relative; bottom: 0px; 
    	background:#09F;
    	clear:both;
    	width:960px;	
    }
    
    </style>
    </head>
    
    
    <body>
    <div id="container">
      <div id="layout_top">Top</div>
      <div id="heading_bar"> Heading Bar  </div>
      
      <div id="layout_col_left">
        <p>Left Column</p>
      </div>
        
     <div id="layout_col_right">
        <p>Right Column</p>
      </div>
        
        
        <div id="layout_col_farright">
        <p>FarRight Column	</p>
        <p>
          <?php
    		include("Scripts/config.php");
    		$Lid = $_GET['LocationID'];
    			if(!$rs=mysql_query("SELECT tblDetails.DetailName, tblLocDetails.DetailValue,tblDetails.DetailType
    			FROM tblDetails
    			INNER JOIN tblLocDetails ON tblLocDetails.DetailID = tblDetails.DetailID
    			WHERE tblLocDetails.LocationID = '$Lid'
    			ORDER BY tblDetails.DetailType, tblDetails.DetailName ASC")) {
    			echo "Cannot parse query";
    					}
    				else
    			 		{
    			echo "<table id=\"tblMyStuff\" table width=\"250\" align=\"left\" cellspacing=\"0\">\n";
    			//echo "<tbody>";
    			
    			$Cat="";
    			while($row = mysql_fetch_array($rs)) {
          			If($Cat!=$row['DetailType']){
    				echo "<tr><td align='left' style='padding-top: 0px;'><strong>".$row['DetailType']."</strong></td></tr>";					
    				}
          				$Cat=$row['DetailType'];
    				echo "<tr>";
          			echo "<td align='left' style='padding-left: 25px;'>".$row['DetailName']."</td>";
          			echo "<td align='left'>".$row['DetailValue']."</td>";
          			echo "</tr>\n";
    				//echo "</tbody>";
    				} 
    				}
    			?>
        </p>
      </div>
       	
        <p>&nbsp;</p>
     	<p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p> 
     
        
    
    </div><!-- container end -->
    </body>
    </html>
    Thank you.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,999
    Thanks
    16
    Thanked 315 Times in 313 Posts
    Blog Entries
    12

    Default

    It might be because you haven't closed your table.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  3. #3
    Join Date
    Feb 2013
    Posts
    58
    Thanks
    10
    Thanked 1 Time in 1 Post

    Default

    You're Right! I closed the table and the required div is at the bottom. However; I did not close it correctly, so I'm only getting the first row and the rest of the table data is everywhere. What am I doing wrong?

    <?php
    include("Scripts/config.php");
    $Lid = $_GET['LocationID'];
    if(!$rs=mysql_query("SELECT tblDetails.DetailName, tblLocDetails.DetailValue,tblDetails.DetailType
    FROM tblDetails
    INNER JOIN tblLocDetails ON tblLocDetails.DetailID = tblDetails.DetailID
    WHERE tblLocDetails.LocationID = '$Lid'
    ORDER BY tblDetails.DetailType, tblDetails.DetailName ASC")) {
    echo "Cannot parse query";
    }
    else
    {
    echo "<table id=\"tblMyStuff\" table width=\"250\" align=\"left\" cellspacing=\"0\">\n";
    echo "<tbody>";

    $Cat="";
    while($row = mysql_fetch_array($rs)) {
    If($Cat!=$row['DetailType']){
    echo "<tr><td align='left' style='padding-top: 0px;'><strong>".$row['DetailType']."</strong></td></tr>";
    }
    $Cat=$row['DetailType'];
    echo "<tr>";
    echo "<td align='left' style='padding-left: 25px;'>".$row['DetailName']."</td>";
    echo "<td align='left'>".$row['DetailValue']."</td>";
    echo "</tr>\n";
    echo "</tbody>";
    echo "</table>";
    }
    }
    ?>

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,999
    Thanks
    16
    Thanked 315 Times in 313 Posts
    Blog Entries
    12

    Default

    Your first row has only one <td> while the second row has two <td> so either add another <td> to the top row or set the one that's there to have colspan="2"
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  5. The Following User Says Thank You to Beverleyh For This Useful Post:

    DS928 (04-15-2013)

  6. #5
    Join Date
    Feb 2013
    Posts
    58
    Thanks
    10
    Thanked 1 Time in 1 Post

    Default

    Figured the table mess out.
    Code:
    <?php
    		include("Scripts/config.php");
    		$Lid = $_GET['LocationID'];
    			if(!$rs=mysql_query("SELECT tblDetails.DetailName, tblLocDetails.DetailValue,tblDetails.DetailType
    			FROM tblDetails
    			INNER JOIN tblLocDetails ON tblLocDetails.DetailID = tblDetails.DetailID
    			WHERE tblLocDetails.LocationID = '1'
    			ORDER BY tblDetails.DetailType, tblDetails.DetailName ASC")) {
    			echo "Cannot parse query";
    					}
    				else
    			 		{
    					echo "<table id=\"tblMyStuff\" table width=\"250\" align=\"left\" cellspacing=\"0\">\n";
    								
    					$Cat="";
    					while($row = mysql_fetch_array($rs)) {
          				If($Cat!=$row['DetailType']){
    					echo "<tr>";
    					echo "<td align='left' style='padding-top: 0px;'><strong>".$row['DetailType']."</strong></td>";
    					echo "</tr>";					
    					}
          				$Cat=$row['DetailType'];
    					echo "<tr>";
          				echo "<td align='left' style='padding-left: 25px;'>".$row['DetailName']."</td>";
          				echo "<td align='left'>".$row['DetailValue']."</td>";
          				echo "</tr>";
    					}
    					echo "</table>"; 
    					}
    		?>
    Once again "You Are The Best!" Thank you so very much! This consumed my entire Sunday!

  7. #6
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,999
    Thanks
    16
    Thanked 315 Times in 313 Posts
    Blog Entries
    12

    Default

    No problem - Sometimes it just needs a fresh pair of eyes.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

Similar Threads

  1. Swiss Army link problems and scrolling problems
    By jcwlibrarian in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 01-31-2011, 04:54 PM
  2. Smooth Menu and IE - Problems over Problems!
    By hinkel11 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-15-2009, 10:27 AM
  3. Problems...
    By alhadath in forum Flash
    Replies: 0
    Last Post: 07-08-2009, 11:15 AM
  4. IE DOM problems...?
    By ??? in forum JavaScript
    Replies: 4
    Last Post: 01-01-2009, 06:14 PM
  5. SQL problems
    By hmsnacker123 in forum MySQL and other databases
    Replies: 8
    Last Post: 08-03-2008, 05:21 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •