Results 1 to 2 of 2
Feb 20, 2014, 05:13 #1
- Join Date
- Mar 2011
- 0 Post(s)
- 0 Thread(s)
Best way to design a grid with CSS?
What is the best method of designing a grid format with CSS?
I am used to using tables to achieve the results. In the past this has allowed us to input product summary's in each cell of a table.
But how can it be done with CSS?
Feb 20, 2014, 06:24 #2
- Join Date
- Jan 2003
- Hampshire UK
- 182 Post(s)
- 6 Thread(s)
From your comments it sounds like you means something like a product image with a product description underneath?
You can in fact replicate a table structure for that using display:table and display:table-cell and do it in much the same way that you would have done with tables. However, it would have the same downside as a table in that columns would not wrap in a fluid environment, which may be what you want in a fixed width design, but generally these days you want elements to wrap to fit the window.
In that case you could use display:inline-block for each element and then it can wrap to a new line as required. You could also float the items but would need to ensure they are all the same height so that they won't snag when they wrap.
Here's a rough demo: