Hi, I am developing a website that has on online menu for a restaurant. The data is pulled from a database and displayed using several divs and a wrapper, this is then repeated to create a 2 column list (using block to display left to right).

The problem I am having is that sometimes it appears to skip a space although all records are still displayed e.g.

record1 | record2
record3 | record4
missing | record5
record6 | record7

or you can check out the website at www.marina-vista.co.uk. This happens at different intervals and since each seperate menu item is repeated I am unsure how this could happen when most records are displayed as normal.

Please post your code, there's not much that can be done without it

I thought you would be able to just check the website so the full code and css are available. Here is the code for the menu items anyway.

<?php do { ?>
        
      <div class="menu_list">
          <div class="food_name"><?php echo $row_menu['food_name']; ?></div>
          <div class="food_price"><?php echo $row_menu['food_price']; ?></div>
          <div class="food_desc"><?php echo $row_menu['food_description']; ?></div>
          <div class="clear"></div>
      </div>
      <?php } while ($row_menu = mysql_fetch_assoc($menu)); ?>
.menu_list {
	float: left;
	width: 50%;
	display: block;
	margin-bottom: 15px;
	padding-bottom: 5px;
}



.food_name {
	float: left;
	width: 220px;
	padding-bottom: 10px;
	color: #333;
	font-size: 17px;
	font-weight: 400;
}
.food_price {
	float: left;
	width: 70px;
	padding-bottom: 10px;
	font-size: 16px;
	color: #333;
}

.food_desc {
	width: 285px;
	float: left;
	color: #5F5F5F;
	overflow: visible;
	margin-bottom: 5px;
	padding-bottom: 5px;
}

I thought you would be able to just check the website so the full code and css are available. Here is the code for the menu items anyway.

Well you can't really see PHP code by looking on the website.

Maybe try to post this in the PHP section, it looks like a PHP issue..

I'm not sure if this is a php issue, it seems to me to be a problem with the layout. The repeating region appears to work properly however, when the issue occurs the container i use to format the repeated data (div id=menu_list_) is pushed across due to the difference in height in the previous divs. Every other time the divs are the same height even if the contents are different lengths.

I think for whatever reason the div above where the gap is appearing is causing the floated div below to be pushed across. I just cant find any reason why this would occur.

Two possibilities:

1. Missing or wrong separator in the data list used by the script.

2. The missing div is hiding under another div.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.