This is similar to a question I’ve asked previously, but with a twist.
I have some content that I’d like to represent semantically in HTML as a list. Each entry in this list has variable content on the left hand side and variable content on the right-hand side. This jsfiddle represents an example of my efforts so far, but you can see that depending on the width of the window and the amount of text on the left-hand side, some of the content can bleed through to the next line.
Here are my requirements:
- The width of the whole list must be able to resize to fit the width of its container.
- The width of the left-hand “cells” should be the same. I am willing to make it fixed, but a percentage of the width is preferable.
- Each row needs to resize itself to fit the height of the items in whichever of the two “cells” is tallest.
Do I need to just bite the bullet and make this a table, or is there some HTML/CSS guru out there that can show me how this is done?
Name/Date (aside) comes before the paragraph in this version, but it allows for a percentage width on the aside. It can also be resized to virtually any size without any rendering issues (unless the width of a column is less than the longest word, in which case you probably have a much bigger issue to deal with).
The CSS:
In the HEAD (to enable html5 elements in older IE):
And in the BODY: