HTML and CSS Reference
In-Depth Information
To Enter <tr> Tags and Attribute Values to Bind XML Elements to a Table
Table 12-34 shows the code to complete the table that will display each row of data. The table contains one
row and five cells of data. The <span> tag and the datafld attribute identify the XML element value to be displayed
in each cell. Inline styles format the contents of the cells.
Table 12-34 Code for <tr> Tags and Attributes to Bind the XML Elements to the HTML Table
Line
Code
68
<tr>
69
<td><span datafld="item-id" style="font-family:arial; font-size: 10pt; font-weight:bold">
</span></td>
70
<td><span datafld="item-description" style="font-family:arial; font-size: 10pt"></span></td>
71
<td><span datafld="item-boh" style="font-family:arial; font-size: 10pt"></span></td>
72
<td style="text-align:right"><span datafld="item-cost" style="font-family:arial; font-size:
10pt"></span></td>
73
</tr>
74
</table>
Line 68 creates a table row with the <tr> tag. Because the table automatically cycles through the data and is
controlled by the datapagesize attribute, only one HTML table row is needed. Lines 69 through 72 create table data
cells (<td> tags) using the <span> tags and the datafld attribute to define the specific XML element data value that
appears in each cell. The <span> tags on lines 69 through 72 use inline styles to format the displayed values. Line 73
is the closing </tr> tag and line 74 is the closing </table> tag. The following step enters the code to complete
the table.
1
line 68.
If necessary, click
in Table 12-34 to bind
the XML elements to
the table rows. Do not
press the e n t e r key
after the closing
</table> tag on line 74
(Figure 12-34).
Enter the code shown
table data cell tags <td>
and span tags <span>
with datafld attribute to
define XML elements to
display in each table cell
do not press
e n t e r key
Figure 12-34
 
Search WWH ::




Custom Search