WML Tutorial

Subjects
1. The xml header tag
2. Using cards (and what are they).
3. Page Layout
4. Accepting user input
5. Inserting hyperlinks.
6. Changing your text appearance.
7. Using pictures.
8. List all the tags.


Tables

Tables in WAP pages follow very much similar rules to those in normal web pages, but there are notable differences.

Firstly, you can't nest tables, that is, have one table sit inside a cell of another table. You also cannot control the borders, they will be whatever the phone wants, but are usually invisible.

When you create a table, you must specify how many columns wide a table is going to be, but you don't define how many rows down it will go. Within each row that you create, you must create a cell for each column.

The tags used in table creation are <table> <td> and <tr>. The table will be as wide as necessary to accommodate the contents that to put in the cells. I would recommend always using a center aligned paragraph to align the table as well, as the phone may use that.

An example follows...

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>

<card id="MainCard" title="This is a first card">
<p align="center">
<!-- create a three column table -->
<table columns="3">
<!-- this is the first row tag-->
<tr>
<!-- this is the first cell -->
<td>cell 1</td>
<!-- this is the second cell -->
<td>cell2</td>
<!-- this is the third cell -->
<td>cell3</td>
<!-- and now you close the row using the </tr> tag-->
</tr>
<!-- this is the second row, note the empty second cell -->
<tr>
<td>cell1</td><td></td><td>cell3</td>
</tr>
<!-- and don't forget to close the table-->
</table>
</p>
</card>

</wml>