View Single Post
Old 03-18-2009, 02:51 AM   #19 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
I create a table with say 2 rows and 4 columns...2 hours later AFTER I have already configured it properly (cellpadding,colors etc)..I find that I need to create within the ONE of the columns another table that contains 4 rows...
Honestly, the first thing I would do in that situation is examine my reasons for creating that kind of complexity and determine what method would be best to simplify the process. Tables or CSS, the less you need to compartmentalize like that the less markup you're going to use and the faster it's going to be -- as well as easier to modify later.

With that said, this example took me about 30 seconds to write;

HTML Code:
<div style="width:400px;height:150px;border:1px dashed red">
    <div style="width:98px;height:148px;border:1px solid blue;float:left">
        <div style="width:96px;height:35px;border:1px dotted green"></div>
        <div style="width:96px;height:35px;border:1px dotted green"></div>
        <div style="width:96px;height:35px;border:1px dotted green"></div>
        <div style="width:96px;height:35px;border:1px dotted green"></div>
    </div>
    <div style="width:98px;height:148px;border:1px solid blue;float:left"></div>
    <div style="width:98px;height:148px;border:1px solid blue;float:left"></div>
    <div style="width:98px;height:148px;border:1px solid blue;float:left"></div>
</div>

<div style="width:400px;height:150px;border:1px dashed red">
    <div style="width:98px;height:148px;border:1px solid blue;float:left"></div>
    <div style="width:98px;height:148px;border:1px solid blue;float:left"></div>
    <div style="width:98px;height:148px;border:1px solid blue;float:left"></div>
    <div style="width:98px;height:148px;border:1px solid blue;float:left"></div>
</div>
Rudimentary at best, but the colorful borders should show you that I accomplished your task with very little effort. From that point I have complete control over each DIV element with further refinements such as margins, padding, backgrounds, etc.

Quote:
If I were to use CSS, I take it that I would be using DIV to create the tables? I guess I've never figured out how I would be able to quickly do what I need to do above using CSS....
It's something that comes with practice, I'm sure. There are some crazy crazy things done with CSS that I couldn't even hope to reproduce at my experience level, but I can guarantee you tables would never accomplish the job. Plus once you include a style sheet with your page, incorporating IDs and Classes, there's just no comparing the cleanliness of the 'code'.

Quote:
If you are aware of any good websites on CSS or books, please let me know...
I learned HTML and CSS primarily by dissecting other web sites and having the W3C open in another window, but StumbleUpon search term CSS turns up some snazzy information. Can't go wrong there.
delayedinsanity is offline  
Reply With Quote
The Following User Says Thank You to delayedinsanity For This Useful Post:
allworknoplay (03-18-2009)