Wireless Markup Language (WML) Tutorial

Tables

The table element may be used to display tabular data. The following attributes may be used with the table element.

Attributes for the table Element
Attribute Description

align

Determines how the table is aligned on the device. The following are the possible options.

  • center
  • left
  • right
<table columns="2" align="center">

columns

Specifies how many columns will be displayed. This is a required field, and cannot be zero.

<table columns="2">

title

Used to specify a title for the table.

<table columns="2" title="Temperatures">

The tr element is used to define a row within the table. The td element is used to define a column within a table. The following example uses a data to display the frequency of radio stations.

stations.wml
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="index" title="Radio Stations">
<p>
    <table columns="2">
    <tr>
        <td>
            Rock FM
        </td>
        <td>
            97.4
        </td>
    </tr>
    <tr>
        <td>
            Jazz FM
        </td>
        <td>
            100.2
        </td>
    </tr>
    <tr>
        <td>
            Wish FM
        </td>
        <td>
            102.45
        </td>
    </tr>
    </table>
</p>
</card>
</wml>

Output From Program

The image shows the screen of a mobile phone with the output from the program.

You might also like...

Comments

About the author

Gez Lemon United Kingdom

I'm available for contract work. Please visit Juicify for details.

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I invented the term Object-Oriented, and I can tell you I did not have C++ in mind.” - Alan Kay