[thelist] list style table, table style list, best practicse?

Zhang Weiwu zhangweiwu at realss.com
Sun Jan 6 22:59:25 CST 2008


For list data I use list, for tabular data I use table. How do you
usually handle a list-type structure?

Example here: (Firefox can open gopher links)


The list-table can nest up to 4 levels, according to the content that I
need to present. There are several problems:

To use a list, problems:

   1. it seems not avoidable to must have a '<div>...</div>' inside
      every <li> in order to specify style for a row of content of a
      list without affecting its sub-lists;
   2. I must align the fields with something like -moz-inline-box or
      inline-block. The limitation is I cannot specify "text-align:
      right" for something with display: inline-block (at least not
      possible in Fx);

To use a table: problems:

   1. It seems I might need to use empty cells to indent the nested items;
   2. It's not easy to assign a style to one cell and its sub-cells;
   3. The javascript that generates the whole thing (yes, it's
      completely generated with js, for a lot of reasons) has been
      written with list structure in mind, thus I need to rewrite a lot
      of things to make a table;

In fact, I didn't start to use neither list nor table yet, now I am
using a <div> structure:

<div id="list-table">
    <!-- a single row -->
    <div><span class="cell1">..</span><span class="cell2">..</span>...</div>
    <!-- a row with a nested/indented row -->
    <div><span class="cell1">..</span><span class="cell2">..</span>...
      <div><span class="cell1">..</span><span class="cell2">..</span>...</div>
    <!-- other rows -->
<!-- you probably can tell, in my current structure I cannot assign a 
   style to a row without affecting sub-rows -->

I just wish to know if there are some best practise over such thing, or
what are structures better than my <div> structure? Thanks a lot in advance.

Real Softservice

Huateng Tower, Unit 1788
Jia 302 3rd area of Jinsong, Chao Yang

Tel: +86 (10) 8773 0650 ext 603
Mobile: 135 9950 2413

More information about the thelist mailing list