XHTML MP Lists

The <ul>, <ol> and <li> elements are used to create lists in XHTML MP.


To create an unordered list, use the <ul> element. Each list item in an unordered list begins with a bullet. The <li></li> tags are used to enclose every list item. This XHTML MP example demonstrates how to create an unordered list:



<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ul>
      <li>Part 1 XHTML MP Introduction</li>
      <li>Part 2 Development of Wireless Markup Languages</li>
      <li>Part 3 Advantages of XHTML MP</li>
      <li>Part 4 WML Features Lost in XHTML MP</li>
    </ul>
  </body>
</html>
















Sony Ericsson T610







Nokia Mobile Browser 4.0




To create an ordered list, use the <ol> element. An ordered list has list numbering. List items are enclosed within <li></li> tags. The following XHTML MP example demonstrates how to create an ordered list.


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ol>
      <li>XHTML MP Introduction</li>
      <li>Development of Wireless Markup Languages</li>
      <li>Advantages of XHTML MP</li>
      <li>WML Features Lost in XHTML MP</li>
    </ol>
  </body>
</html>



















Sony Ericsson T610







Nokia Mobile Browser 4.0




You can make use of the start attribute of the <ol> element to specify the starting number of the sequence, like this:


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ol start=”4″>
      <li>XHTML MP Introduction</li>
      <li>Development of Wireless Markup Languages</li>
      <li>Advantages of XHTML MP</li>
      <li>WML Features Lost in XHTML MP</li>
    </ol>
  </body>
</html>




The result of the above XHTML MP example in some WAP browsers is shown below:

















Sony Ericsson T610







Nokia Mobile Browser 4.0


With WAP CSS, you can have more precise control over the outlook of a list. For example, you can control the bullet shape of unordered lists and the list numbering of ordered lists (for example, changing the list numbering from “1, 2, 3…” to “i, ii, iii…”).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.