The table element may be used to display tabular data. The following attributes may be used with the table element.
Attribute | Description |
---|---|
|
Determines how the table is aligned on the device. The following are the possible options.
<table columns="2" align="center">
|
|
Specifies how many columns will be displayed. This is a required field, and cannot be zero. <table columns="2">
|
|
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
Comments