To div or not

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

To div or not

Nicholas Moore
My ignorance of html has been exposed by a comment about the advantages of div over table for layout.

I see that in Aida a divTag is invoked automatically if attributes are set. Does anyone have any comments about the appropriate use of divs against tables?

Cheers
--
NJM TSR-i

Nicholas J Moore
Limoges
France


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: To div or not

Eli Green-2
Hi,

HTML purists will tell you that <table> should only be used for data that is in fact tabular. For laying out the various blocks of a page, DIVs are in fact the "blessed" approach. This preserves the semantic structure of your HTML document and in fifty years when Google has in fact developed into some kind of artificial intelligence, that might matter.

But nested tables ala HTML 3 can get really ugly quite quickly when you try to read the code. I don't know if it's still true, but browsers used to render a page with a bunch of separate DIVs much faster than one with a dozen nested tables.

I would say that you should use DIV when you can: header, footer, menus, main content, etc. On the other hand, the act of laying out forms nicely without the use of tables has always seemed to me to be an exercise in masochism. So the exception to the above rule for me has always been forms with pairs of labels/input widgets. If somebody is willing to correct me, I will eat my words.

Eli

On Wednesday, January 28, 2009, at 11:25AM, "Nicholas Moore" <[hidden email]> wrote:

>My ignorance of html has been exposed by a comment about the advantages
>of div over table for layout.
>
>I see that in Aida a divTag is invoked automatically if attributes are
>set. Does anyone have any comments about the appropriate use of divs
>against tables?
>
>Cheers
>--
>
>*Nicholas J Moore*
>Limoges
>France
>
>
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: To div or not

Michael Rueger-6
Eli Green wrote:

> I would say that you should use DIV when you can: header, footer,
> menus, main content, etc. On the other hand, the act of laying out
> forms nicely without the use of tables has always seemed to me to be
> an exercise in masochism. So the exception to the above rule for me
> has always been forms with pairs of labels/input widgets. If somebody
> is willing to correct me, I will eat my words.

would be an interesting feature to allow the programmer to layout the
page (web components/elements) in a table (layout) in AIDA, but then
have the appropriate combination of DIVs and CSS entries generated for
the client.

Michael
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: To div or not

Nicholas Moore
In reply to this post by Eli Green-2
Thanks Eli - very helpful.
Nicholas

Eli Green wrote:
Hi,

HTML purists will tell you that <table> should only be used for data that is in fact tabular. For laying out the various blocks of a page, DIVs are in fact the "blessed" approach. This preserves the semantic structure of your HTML document and in fifty years when Google has in fact developed into some kind of artificial intelligence, that might matter.

But nested tables ala HTML 3 can get really ugly quite quickly when you try to read the code. I don't know if it's still true, but browsers used to render a page with a bunch of separate DIVs much faster than one with a dozen nested tables.

I would say that you should use DIV when you can: header, footer, menus, main content, etc. On the other hand, the act of laying out forms nicely without the use of tables has always seemed to me to be an exercise in masochism. So the exception to the above rule for me has always been forms with pairs of labels/input widgets. If somebody is willing to correct me, I will eat my words.

Eli

On Wednesday, January 28, 2009, at 11:25AM, "Nicholas Moore" [hidden email] wrote:
  
My ignorance of html has been exposed by a comment about the advantages
of div over table for layout.

I see that in Aida a divTag is invoked automatically if attributes are
set. Does anyone have any comments about the appropriate use of divs
against tables?

Cheers
-- 

*Nicholas J Moore*
Limoges
France


    
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
  

--
NJM TSR-i

Nicholas J Moore
Limoges
France


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: To div or not

Janko Mivšek
In reply to this post by Michael Rueger-6
Michael Rueger pravi:

> Eli Green wrote:
>
>> I would say that you should use DIV when you can: header, footer,
>> menus, main content, etc. On the other hand, the act of laying out
>> forms nicely without the use of tables has always seemed to me to be
>> an exercise in masochism. So the exception to the above rule for me
>> has always been forms with pairs of labels/input widgets. If somebody
>> is willing to correct me, I will eat my words.
>
> would be an interesting feature to allow the programmer to layout the
> page (web components/elements) in a table (layout) in AIDA, but then
> have the appropriate combination of DIVs and CSS entries generated for
> the client.

And yet another possibility would be to extend a div support as we have
for tables, and which simplicity is responsible to quite a degree for a
table overuse in Aida.

Table example:

        e cell cell addText: c1. e cell newCell addText: c2;
        e cell newRow.
        e cell cell addText: c3 e cell newCell addText: c4;

Here we have a table nested into another table. This is a hell hard to
do the traditional way with WebTableRows, WebTableCells.

Pretty similar problem we have with DIVs. Look for instance this code
from the new Aida site:

  e := WebElement newClass: #'primary-content'.
  e add: ((WebElement newClass: #'info-a')
       add: ((WebElement newClass: #'wrap-info-1a') "top part"
          add: ((WebElement newClass: #'wrap-info-2a')
             add: self downloadScriblet;
             add: self sloganScriblet; yourself);
          yourself);
       yourself).

Complicated and ugly as a hell. So I already started to think to
introduce div support into WebElements:

  e := WebElement new.
  e div class:#'primary-content'.
  e div div class: #'info-a'.
  e div div div class: #'wrap-info-1a')
  e div div div div class: #'wrap-info-2a'
       add: self downloadScriblet;
       add: self sloganScriblet.
  e newDiv.
  e div class: ..
  e div div class: ...

etc.

What do you think, idea any good?
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida