Unordered Lists
[Previous] [Main] [Next]

 
An unordered list is a list in which the list items are preceded by a bullet symbol instead of a sequential number.  
 
To create an unordered list, specify unordered_list as the first argument to the htmlList constructor, or use the Type() method.  
 
Several options exist for specifying the bullet style used for the list:  
  • bullet_disc
  • bullet_circle
  • bullet_square
 
The bullet style can be specified as the second argument in the constructor, or via the Numbering() method.  
 
As with ordered lists, unordered lists can be also nested. To create a sublist with it's own set of bullets, simply instantiate another htmlList object, populate it with the list items of interest, then insert the entire list into the parent list.  
 
Example
 
#include <stdio.h>  
#include <stdlib.h>  
#include <dcmicro/htmlpp/htmlpp.h>  
 
int main( void )  
{  
   htmlCgi   server ;  
   htmlPage  page( "html++ example application" ) ;  
 
   //  Create the sublist of lossless algorithms  
   htmlList lossless( unordered_list, bullet_square ) ;  
   lossless << "Crusher"  
            << "LZ77"  
            << "LZW"  
            << "Huffman" ;  
 
   //  Create the sublist of lossy algorithms  
   htmlList lossy( unordered_list, bullet_square ) ;  
   lossy << "JPEG"  
         << "Fractal"  
         << "Wavelet" ;  
 
   //  Create the main list of topics and subtopics  
   htmlList topics( unordered_list, bullet_disc ) ;  
   topics << "Lossless algorithms"  
          << lossless  
          << "Lossy algorithms"  
          << lossy ;  
 
   //  Insert the entire list, along with a heading,  
   //  into the page.  
   page << htmlHeading(2, "Types of Compression Alogithms" )  
        << topics ;  
 
   server << page ;  
   return 0 ;  
}  
 
Program Output
 
Content-Type: text/html  
<HTML>  
<HEAD>  
<TITLE>html++ example application</TITLE>  
</HEAD>  
<BODY>  
<H2>Types of Compression Alogithms</H2>  
<UL TYPE="DISC"><LI>Lossless algorithms</LI>  
<UL TYPE="SQUARE"><LI>Crusher</LI>  
<LI>LZ77</LI>  
<LI>LZW</LI>  
<LI>Huffman</LI>  
</UL>  
<LI>Lossy algorithms</LI>  
<UL TYPE="SQUARE"><LI>JPEG</LI>  
<LI>Fractal</LI>  
<LI>Wavelet</LI>  
</UL>  
</UL>  
</BODY>  
</HTML>  
 
 

ex_unorderedlist.gif  




©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.