Hi to all,
I'm wondering how can I put two tables in the same line!
Thanks in advance!
Hi to all,
I'm wondering how can I put two tables in the same line!
Thanks in advance!
Use:Code:display: inline;
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Would the same apply to divs?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Nope, for divs you have to use:
Code:float:left
- Mike
The same would apply to divs, yes. There are fundamental differences between floating an element and making it inline.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Becomes: testingtesting2Code:<div style="display:inline;">testing</div><div style="display:inline;">testing2</div>
Very nice.
Now using divs instead of tables is actually possible without bizarre css stuff, like absolute positioning which doesn't work in many cases anyway. Heh. I wish I'd known this before....
One thing remains, though... could you set the height/width of each of those elements as well?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
No. That's where floating comes in. Using display: inline; causes them to be rendered as inline elements, like <span>, whose size and position is dictated by the contents. Floating them, on the other hand, means keeping them as block-level elements, but rather than having them take up all the space on a line, stacks them against one side of the parent element. Try it:Code:<div style="border: 3px solid blue; float: left; width: 40%; height: 20em;">Testing</div><div style="border: 3px solid red; float: left; width: 40%; height: 20em;">Testing2</div>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Hey guys, thanks a lot!
Thanks, Twey. Still seems like it would be a hassle to replace tables, then.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
It can be, yes, and there are some layouts that simply can't be done. It's usually easy enough, though.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks