Webmaster

Wap/WML : Advanced WML
Contents ]
Jean-Michel Blanchard

Tables

WML allows you to create tables inside decks. Don't think that you will be able to obtain real layouts. WAP tables only aim to build tables, nothing more. At present, we cannot add any transparency to borders in order to hide them and possibilities are limited because of the small displays.

To create a WAP table, use the <table> tag with the columns attribute to specify the number of columns you want. The syntax for the table body is similar to the one used in HTML: the <tr>...</tr> tags define the table rows and the <td>...</td> tags delineate each cell.

Let's see how to create a table containing two columns and two rows:

<card id="card" title="Table">
<p>
<table columns="2">
<tr><td> News </td><td> Search </td></tr>
<tr><td> WapUK </td><td> Directory </td></tr>
</table>
</p>

Here is the result produced by the above code:



Figure 4: A table in your telephone

The right value. Do not write any value for the columns attribute. If the value is smaller than the real number of columns to be displayed, they will merge and their respective contents will get mixed up. Conversely, if the number is higher than the real number of columns, you will obtain additional empty columns.

You cannot create heading cells inside a WAP table. But you can avoid the problem by inserting a couple of highlighting tags in the cells of the first row, as follows:

<tr><td><b> News </b></td><td><b> Search </b></td></tr>
<tr><td> WapUK </td><td> Directory </td></tr>

You can easily obtain table headings:



Figure 5: Table headings




  1   2   3