SoFunction
Updated on 2025-04-07

WML Learning Third Display Text

Display text
WML is basically the same as HTML in the display of text. The text field is contained between <p align= "alignment" mode=" wrapmode"> and </p>. The align attribute specifies the alignment of the text in this paragraph. The default is left, and the right and center can be selected in other ways. The mode attribute specifies whether to automatically wrap when no text is displayed on a line. The default is wrap wrap. If you select nowrap, it will be displayed on a line. The browser will display all text through a mechanism similar to a horizontal scroll bar.

The same is true for the new line tag. Here I will replace it first. If there are multiple <input> or <select> in the form, do not use it during the time, otherwise the mobile browser will think it is a breakpoint and display the form page.

The decorative tags of text include <b>, <i>, <u>, <em>, <strong>, <big> and <small>, and the meaning is the same as in HTML.

The display tag of the table is also similar to HTML. It is used to display it using <table title="name" align="left|right|center" columns="number of columns">, <tr> and <td>. The title attribute of <table> is used to name the table. The columns attribute specifies the number of columns in the table, and cannot be 0. The optional align attribute is the same as mentioned above. The table can contain text and pictures.

 
-------------- 
<?xml version="1.0"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "/DTD/wml_1."> 

<wml> 
<card> 
<p align="center"> 
<i>Hello</i><br/> 
<b><i>World!</i></b> 
<table title="mytable" align="right" columns="2"> 
<tr> 
<td>1-1</td> 
<td>1-2</td> 
</tr> 
<tr> 
<td>2-1</td> 
<td>2-2</td> 
</tr> 
</table> 
</p> 
</card> 
</wml> 

Show pictures

The tags that display pictures (1-bit black and white BMP pictures) are similar to HTML. <img alt="text" src="url" localsrc="icon" align="left" height="n" width="n" vspace="n" hspace="n"/>. Alt and src are required in the properties, and others are optional. It should also be noted that <img> should be placed in <p>, and cannot be placed in functional labels such as <do> and <option> and menu labels.
*alt attribute is used to specify the text to be displayed when the phone does not support image display.
*src attribute specifies the URL of the image, but when the following localsrc attribute is available, the mobile browser ignores the src attribute.
The *localsrc attribute is used to specify the icons displayed in the mobile phone ROM. If they cannot be found, they will go to the Server to search.
*The optional align attribute is used to indicate the alignment of the image with the current line of text. The default value is bottom, and optional to and middle.
*Height, width, vspace, and hspace attributes specify the length, width of the image and the spacing around text respectively. Currently, not all WAP phones support these attributes.

 
--------------- 
<?xml version="1.0"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "/DTD/wml_1."> 

<wml> 
<card> 
<p align="center"><img alt=":)" src="" localsrc="smileyface"/></p> 
</card> 
</wml>