Jump to content

Styling items brough back from db


deansaddigh

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.