HTML
  Home arrow HTML arrow Page 4 - Designing with Nested HTML Lists
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Designing with Nested HTML Lists
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2009-05-15

    Table of Contents:
  • Designing with Nested HTML Lists
  • Using nested HTML lists
  • Coding multiple sub lists
  • Building a nested HTML list with multiple sub-levels

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Designing with Nested HTML Lists - Building a nested HTML list with multiple sub-levels


    (Page 4 of 4 )

    In the section that you just read, I explained how to build a nested HTML list comprised of multiple sub lists with one level of depth. Nonetheless, as you might have guessed, it's possible to expand the list's hierarchical structure and incorporate more sub-levels with minor effort.

    Bearing in mind this concept, below I coded a brand new example that shows how to construct a nested list that is also "nested within another." Does that sound a bit confusing? Don't worry; the following code sample should dissipate any doubts that you might have on this topic:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    <title>Example on building multiple nested HTML lists</title>

    </head>

    <body>

    <h1>Example on building multiple nested HTML lists</h1>

    <ul>

    <li>List Item 1

    <ul>

    <li>Sub Item 1</li>

    <li>Sub Item 2</li>

    <li>Sub Item 3</li>

    <li>Sub Item 4</li>

    <li>Sub Item 5</li>

    </ul>

    </li>

    <li>List Item 2

    <ul>

    <li>Sub Item 1

    <ul>

    <li>Sub Item 1</li>

    <li>Sub Item 2</li>

    <li>Sub Item 3</li>

    <li>Sub Item 4</li>

    <li>Sub Item 5</li>

    </ul>

    </li>

    <li>Sub Item 2</li>

    <li>Sub Item 3</li>

    <li>Sub Item 4</li>

    <li>Sub Item 5</li>

    </ul>

    </li>

    <li>List Item 3

    <ul>

    <li>Sub Item 1</li>

    <li>Sub Item 2</li>

    <li>Sub Item 3</li>

    <li>Sub Item 4</li>

    <li>Sub Item 5</li>

    </ul>

    </li>

    <li>List Item 4

    <ul>

    <li>Sub Item 1</li>

    <li>Sub Item 2</li>

    <li>Sub Item 3</li>

    <li>Sub Item 4</li>

    <li>Sub Item 5</li>

    </ul>

    </li>

    </ul>

    </body>

    </html>


    Even though at first sight the structure of the above nested HTML list seems to be quite complex, the truth is that it's fairly simple. In this specific case, an additional sub level has been incorporated into the second sub list, which expands its hierarchy even more -- but this apparently complicated process is reduced to appending as many child lists as needed. That's all.

    Finally, the following screen capture should give you a more clear idea of how the nested HTML list created a few lines before is displayed on the screen:



    And with this concluding hands-on example, I'm finishing this introductory chapter on building nested HTML lists. As usual, feel free to edit all of the code samples developed in this tutorial, so you can get a more solid background in creating these useful web page elements.

    Final thoughts

    In this first episode of the series, I walked through the basics of building nested HTML lists. As you saw before, this process is pretty straightforward and doesn't offer major difficulties, even if you're just getting started using lists within your own web sites.

    In the forthcoming article, I'll be discussing how to improve the visual appearance of nested lists by using a few simple CSS styles. Thus, now that you've been warned about the topics that will be covered in the next tutorial, you don't have any excuses to miss it!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This introductory part of the series goes through the basics of creating nested...
     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek