HTML and CSS Reference
In-Depth Information
Table 12-33 Code for <table> and Table Header and Row Tags (continued)
Line
Code
63
<th>Description</th>
64
<th>In Stock</th>
65
<th>Cost</th>
66
</tr>
67
</thead>
Line 59 starts the table definition with the <table> tag and includes an id attribute to name the table,
inventoryStock, which relates to the onClick event handler for the buttons and built-in functions. The datasrc
attribute must match the name of the data source object defined in the <xml> element on line 3 and be preceded
by a pound sign (#) to read: #dsoTableList. The datapagesize attribute sets the size of the page to 4, so the table
will displayed four records or rows at a time. Line 60 starts the table header with the <thead> tag. The header
is a single row indicated in line 61 with the <tr> tag. Lines 62 to 65 contain the text for the column headings
with the <th> tags. Line 66 closes the row tag </tr> and line 67 closes the header with the </thead> tag. The
border and cellpadding attributes for the table are defined in the embedded style sheet. The following step starts
the HTML table.
1
Click line 58, press the
e n t e r key once.
On line 59, enter
the code shown in
Table 12-33 to create
the table header and
press the e n t e r key
once after line 67
(Figure 12-33).
datapagesize
attribute defines
number of items
displayed per page
datasrc attribute
associates id with src
attribute in XML tag
HTML <table>
tag and table
column headers
id attribute defines
table name and
associates table
with buttons
press e n t e r
key once
Figure 12-33
 
Search WWH ::




Custom Search