Wml-tables

提供:Dev Guides
移動先:案内検索

WML-テーブル

<tr>および<td>とともに<table>要素を使用して、WMLでテーブルを作成します。 WMLはテーブルのネストを許可しません

<table>エレメントは、<p> …​ </p>エレメントと一緒に配置する必要があります。

<table/>要素は、次の属性をサポートしています。

Attribute Value Description
columns number Sets the number of columns in the table
align
  • L
  • C
  • R

a

列の水平方向のテキスト配置を指定するには、align属性に3文字を割り当てる必要があります。 各文字は、列の水平方向のテキスト配置を表します。 文字はL、C、またはRのいずれかです。 たとえば、次の設定をテーブルに適用する場合:

  • 最初のテーブル列-左揃え * 2番目のテーブル列-中央揃え * 3番目のテーブル列-右揃え

次に、_align_属性の値をLCRに設定する必要があります。

xml:lang language_code Sets the language used in the element
class class data Sets a class name for the element.
id element ID A unique ID for the element.

以下は、<table>要素の使用方法を示す例です。

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

<wml>

<card title="WML Tables">
<p>
<table columns="3" align="LCR">
    <tr>
      <td>Col 1</td>
      <td>Col 2</td>
      <td>Col 3</td>
    </tr>

    <tr>
      <td>A</td>
      <td>B</td>
      <td>C</td>
    </tr>

    <tr>
      <td>D</td>
      <td>E</td>
      <td>F</td>
    </tr>
</table>
</p>
</card>

</wml>

これにより、次の結果が生成されます。

WAP例5