I'll start with an ASCII art illustration of what I want to achieve:
Category title
Title Title
+-------+ +-------+
| | | |
| | | |
| Image | | Image |
| | | |
| | | |
+-------+ +-------+
Subtitle Subtitle
Category title
Title Title
+-------+ +-------+
| | | |
| | | |
| Image | | Image |
| | | |
| | | |
+-------+ +-------+
Subtitle Subtitle
So I have these categories which contain items. Each item consists of a Title, a Subtitle and an Image. The images are of different sizes. Their widths are constant 150px, but heights range from 150px to 252px. And I cannot predict what sizes there will be in the future, although they should be somewhere around this size. You can assume that width is constant 150px, and height can vary between 150px and 300px.
The count categories and items in each category, of course, is arbitrary. Althought in each category there will be at least one item (otherwise I don't show the category). The lengths of titles and subtitles are also variable, although mostly they are pretty short.
The effect that I want to create is the following:
- Item title and subtitle are rendered right next to the image (above and below) without any significant whitespace inbetween.
- When the items in a category are too many, they start wrapping and create more rows. There is no horizontal scrolling. The rows should be clearly beneath each other. As the window width changes, the items rearrange themselves automatically.
- If the item title or subtitle are a bit longer, they should wrap. They should not extend significantly beyond the image width;
- The category header should have a clear whitespace between it and the item rows above and below.
- Category title is centered in the page; Item titles and subtitles are centered relative to their images.
I don't care if the effect is achieved by TABLEs, DIVs or The Force. I just want it to look like that. :) Is this possible and if yes, how to do this?
If not, can anyone suggest an alternate layout which would encapsulate the same information and would look good on different browser sizes?