Alternate approach of creating tables

Discussion in 'HTML & Website Design' started by elixir, Nov 30, 2005.

  1. #1
    What is the alternate approach in creating a "table of contents" instead of using table tag?

    I tried pre and span tags but no luck since there is no "width" attribute for span.

    What do you recommend?
     
    elixir, Nov 30, 2005 IP
  2. elixir

    elixir Banned

    Messages:
    72
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    as i see it is not recommend using pre tag to create tables. So is there any other way to create tables? I am just trying to avoid using tables within tables since structure of the webpage is built using tables.
     
    elixir, Nov 30, 2005 IP
  3. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    A table of contents would almost certainly be an ordered list. So you might have
    <div class="TOC">
      <ol>
        <li>Section A</li>
        <li>Section B</li>
        <li>Section C
          <ol>
            <li>Sub-section a</li>
            <li>Sub-section b</li>
          </ol>
          </li>
      </ol>
    </div>
    Code (markup):
    After that we just need to style it so it looks the way you want. I don't really know how you want it to look yet so you'll have to come back with a description.
     
    FeelLikeANut, Nov 30, 2005 IP
  4. my44

    my44 Peon

    Messages:
    722
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, I agree. Bullet list is probably the best because you can easily add and remove items from the lists.

    I've tried the table thing when doing sitemap list, it does look nice but when I had new things to add, it can be a b*tch :)
     
    my44, Nov 30, 2005 IP