?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
Attribute Name | Type | Required | Default | Description |
---|---|---|---|---|
loop | array | Yes | n/a | array of data to loop through |
cols | integer | No | 3 | number of columns in the table |
table_attr | string | No | border="1" | attributes for table tag |
tr_attr | string | No | empty | attributes for tr tag (arrays are cycled) |
td_attr | string | No | empty | attributes for td tag (arrays are cycled) |
trailpad | string | No | | value to pad the trailing cells on last row with (if any) |
hdir | string | No | right | direction of one row to be rendered. possible values: left / right |
vdir | string | No | down | direction of the columns to be rendered. possible values: up / down |
屬性 | 類型 | 是否必須 | 缺省值 | 描述 |
---|---|---|---|---|
loop | array | Yes | n/a | 待遍歷的數(shù)組 |
cols | integer | No | 3 | 表格的列數(shù)目 |
table_attr | string | No | border="1" | 表格的屬性 |
tr_attr | string | No | empty | 行標簽屬性(或輪轉(zhuǎn)數(shù)組) |
td_attr | string | No | empty | 列標簽屬性(或輪轉(zhuǎn)數(shù)組) |
trailpad | string | No | | 最后一行附加的數(shù)據(jù)(如果有的話) |
hdir | string | No | right | 行的對齊方式,可能的值為 left 或 right |
vdir | string | No | down | 列的對齊方式,可能的值為 up 或 down |
html_table is a custom function that dumps an array of data into an HTML table. The cols attribute determines how many columns will be in the table. The table_attr , tr_attr and td_attr values determine the attributes given to the table, tr and td tags. If tr_attr or td_attr are arrays, they will be cycled through. trailpad is the value put into the trailing cells on the last table row if there are any present.
自定義函數(shù) html_table 將數(shù)組中的數(shù)據(jù)填充到 HTML 表格中. cols 屬性決定表格有多少列. table_attr , tr_attr 和 td_attr 屬性決定表格中 tr 和 td 標簽的一些附加屬性. 如果 tr_attr 和 td_attr 屬性值為數(shù)組,將輪流使用其中的值. 如果指定了 trailpad 屬性,將在表尾最后一行附加一些數(shù)據(jù).
Example 8-13. html_table
|