I’m trying to layout a report using a CSS layout that I had previously done with a table. I can get everything looking right in IE, but not Firefox (go figure).
It has nested divs and everything lines up correctly unless the label block overflows into multiple lines. The last response in the second column is incorrectly lined up under the previous response instead of it’s associated label.
What am I missing?
Here is a code example:
Legal Name (Last, First, MI):
Smith, Bob, L
Social Security #:
111 N Main St
Do you and your spouse read, write, speak, and understand the English language?
Do you have an adoption pending?
HTML code is right there..
Well, obviously the last line is wrongly aligned because it is the only one that has question on multiple lines. So what you would have to do is make the answer to be on multiple lines also, simply add two <br/> tags in front of your last question and it will be fixed.
EDIT: Agh, or not.. this messes it up in IE. I hate all the differences in browsers. Couldn’t they just leave the language as it is and make it work the same everywhere? Well, in this case I would just use tables, or if I really wanted to use divs then make different div for every question and answer, But that is probably the most noobish solution. Probably because I am one in CSS..
This reply has been reported for inappropriate content.
There is an argument for this being tabular data. I don’t advocate the use of tables often – but sometimes there’s content that suits exactly what tables were designed for.
Endeavour to use standards compliant tables and only for the data in div.left and not for the page layout as a whole. Also, use the caption tag and a proper thead/tbody structure… and enjoy :)
on a side note – p is a block level element naturally so need not be declared each time.
Thanks for the tips, guys. I wasn’t completely adverse to using tables in this scenario, but the code is much cleaner without the overhead of all the associated table tags. I will re-think the design.
If anyone has any other ideas that would work nicely for a layout, I’m all ears. :D
You must be logged in to reply to this topic.