script on a web page that calls a web service, gets html code returned
The code for the HTML generation can be reused and maintained separately.
5.3: "Do not use tables for layout unless the table makes sense when linearized. Otherwise, if the table does not make sense, provide an alternative equivalent (which may be a linearized version). [Priority 2]".
5.4: "If a table is used for layout, do not use any structural markup for the purpose of visual formatting. [Priority 2]".
School 1 is that tables are OK for styling, and it is possible to style this was. I don't do this.
School 2 [the one I belong to] is that you should never use tables for formatting as it loses the flexibility for formatting. Additionally (possibly more importantly) the html tags have a symantic meaning, tables are for tabular data. This reaps other benefits too: a well designed page can be ordered so a screen reader (for the partially sighted/blind) reads in the logical order which isn't always the same as the visual order. I almost (read 99.99%) never put any styling inline in the HTML, I do it all through CSS. See CSS Zen Garden[^] for examples. For each design the only thing that is different is the stylesheet.
IMO you should use the tags for their intended symantic purpose, others do have a different point of view.
That is Sir to you, unless you mean floated . I may be dead ringer for Kate Winslet (see my signature), but in reality I am a whacking great chap, which is why I found the Kate Winslet thing funny as I'm about as far removed from her as you can get (or I would be if I grew a beard)! In any case, please call me Keith or Abu Adam.
Anyhoo in response to your question, no I wouldn't do it that way: I'd put them into nested divs, something like:
//root styling here
div #tree > div
//1st level styling here
div #tree > div > div
//2nd level styling here
The actual styling depends on what you want to do, this might not be the most efficient.
One further thing I'd like to suggest before you procede: take a look at the tutorials here: http://www.w3schools.com/[^] especially "Learn HTML" and "Learn CSS". I get my student to go through these as an introduction to our "Web Programming" course.