deansaddigh Posted December 1, 2009 Share Posted December 1, 2009 I dont want to use a table to hold my products i bring back from the db. http://www.mailordercorals.com/ If you look at this site they dont seem to be using a table to hold the products and its details they have brought back from db. on their new products section Can anyone help me do this? Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted December 1, 2009 Author Share Posted December 1, 2009 What? Sorry if i have posted in wrong section or done something wrong Quote Link to comment Share on other sites More sharing options...
haku Posted December 2, 2009 Share Posted December 2, 2009 The reason they are not using a table, is because the data isn't tabular information. Tables cross reference two or more 'categories'. In this case, there are no categories, they are just creating a grid, and as such are not cross referencing anything. So they are correct in not using tables, as tables should only be used for tabular information, and not layout. As to how they are doing it, they have put all the items in a list (which is correct, since it is a list of items), and then they are floating the list items left. When they run out of space on a line, the next item automatically drops to the line below. To learn how to do floats, you should run through all the tutorials on this page: http://css.maxdesign.com.au/floatutorial/ It's a little old, and some of it is a bit dated, but if you do all the tutorials on that page, you will get a good solid understanding of the basic ideas of floats and how they can be used. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted December 2, 2009 Author Share Posted December 2, 2009 Thanks for your help, ill read the tutorial you sent me, one last question im a bit confused on is, so there items arnt being pulled from a db? Quote Link to comment Share on other sites More sharing options...
haku Posted December 2, 2009 Share Posted December 2, 2009 I think you are mixing up database tables and html tables. Database tables are a concept used to express how data is organized in a database. Html tables are grids that cross reference two data types. They are most likely using a database to store their info, but I'm not the developer for that site, so I'm just speculating. But you seemed to be asking about HTML tables in your first post. That's what my whole post addressed, nothing to do with database tables. Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted December 2, 2009 Share Posted December 2, 2009 Thanks for your help, ill read the tutorial you sent me, one last question im a bit confused on is, so there items arnt being pulled from a db? they probably are using a db but you cant see the php code that is stored on the server, the php generates html code whihc is why that is all that you see. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted December 2, 2009 Author Share Posted December 2, 2009 Ok sorry if my explanation was rubbish. I know they are more than likely pulling those products from the db. But when they are displaying there products are they using tables to layout the items,because i cant see any table code. Or are pulling products from the db then using divs and css to layout them out ? Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted December 2, 2009 Share Posted December 2, 2009 well haku actually explained the answer to that question, it then seemed that you were asking the question that i then answered and you now should revert back to haku's answer which will aid you in solving your problem. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted December 2, 2009 Author Share Posted December 2, 2009 Thanks guys i understand now cheers again Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted December 2, 2009 Author Share Posted December 2, 2009 Ok im Doing the same now pulling products from the db and displaying them in lists. <?php '<ol>'?> <!-- Make the product name clickable and pass through its id --> <?php echo '<li><a href="product_details.php?productid='.$productid.'">' .$productname.'</a></li>';?> <?php echo $row ['ProductPrice'];?> <?php echo '<a href="'.$file.'" target="_blank" rel="lightbox"><img src="'.$file.'" width="100" height="100"/>';?> <?php '</li>'?> <?php '</ol>'?> But how do i put this in a <li> <?php echo $row ['ProductPrice'];?> ive tried <?php echo $row'<li> ['ProductPrice']</li>';?> but doenst work Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted December 2, 2009 Share Posted December 2, 2009 <?php echo('<li>' . $row['ProductPrice'] . '</li>'); ?> Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted December 2, 2009 Author Share Posted December 2, 2009 Thank you very much Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted December 2, 2009 Share Posted December 2, 2009 you could also do a <?php echo("<li>$row['ProductPrice']</li>"); ?> but i preffer the example that i posted first because as demonstrated, the syntax is highlighted properly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.