[thelist] Re: thelist Digest, Vol 7, Issue 44

Diane Soini dianesoini at earthlink.net
Fri Sep 19 23:29:52 CDT 2003

On Friday, September 19, 2003, at 05:07 PM, 
thelist-request at lists.evolt.org wrote:

> What would you think about about an approach where the
> overall page structure is a table but, sub elements
> are styled DIV's? [Obviously it makes sense to present
> tabular data like result sets in a table]. Is this
> what you meant by "move most of the presentation into
> the CSS and leave behind only a few layout-by-table
> html structures"?

In the example I was thinking of divs are used here and there, but not 
much. You can do it however you want, divs or tables. My limitation was 
that the programmers didn't know html well, didn't know what a div was, 
and didn't have time or desire to learn about it.

The way I did this was to look at the application visually and define 
"things" on the screen, like widgets for doing or displaying things.

So you have a "thing." You define a class (or id) for it. .Grid{}. Then 
you define the descendent selectors for that .Grid tr{} .Grid th{} 
.Grid td{} .Grid a{} etc. Then all the programmer has to know is if 
they want to spit out a horizontal table of data, just make a table 
<table class="Grid">. No more attributes or classes need be defined 
because it's all in the CSS. All the programmers have to do is make 
sure that they use <th> for header cells, <td> for data cells.

Same can be done with divs. Define a class (or id if it is unique) for 
it .DivThingy{}. Then define the descendant selectors. .DivThingy a{} 
.DivThingy ul{} .DivThingy li{} .DivThingy p{} etc. Then all you have 
to do is <div class="DivThingy"> and all the descendents of that div 
that were defined will have the correct look and feel. As long as a 
structure of html you define is followed. You still have to make sure 
the programmers follow your structure. But if your structure is plain 
html without a lot of attributes, you will have better adherence, and 
cleaner code as well. And when it comes time to change things, you'll 
have a lot less work to do, and a lot less people to consult and 

Doesn't work for everything, but it comes really close and it makes 
people happy that they don't have to worry about the attributes and 
style stuff.

More information about the thelist mailing list