>[danger] 友情提示:建構器目前隻支援HisiPHP Pro版本([我要更新](https://www.hisiphp.com/authorize.html))
## 資料表格(table)
| 參數 | 類型 | 必須 | 預設 | 說明
| --- | --- | --- | --- | --- |
| type | string | Y | | 固定值:table |
| title | string | Y | | 标題 |
| cols | array | Y | | 設定表頭,詳見**表頭參數**|
| data | array | N | | 初始資料 |
| del_url | string | N | | 删除時觸發的連結 |
## 表頭參數(cols)
| 參數 | 類型 | 必須 | 預設 | 說明
| --- | --- | --- | --- | --- |
| type | string | Y | | 固定值:text |
| title | string | Y | | 标題 |
| field | string | Y | | 字段名 |
| value | string/int | N | | 預設值 |
>[info]![](https://img.kancloud.cn/3d/0c/3d0cef5e3411d6554c689940abc61f86_1152x440.png)
>[]示例代碼:
```
$assign['buildForm']['items'] = [
[
'type' => 'table',
'title' => '資料表格',
'name' => 'table',
'data' => [// 初始資料
[
'text' => '紅色',
'color' => '#f00',
'image' => 'red.jpg',
],
[
'text' => '黑色',
'color' => '#000',
'image' => 'black.jpg',
],
],
'cols' => [//設定表頭
[
'title' => '文字',// 标題
'type' => 'text',// 類型
'field' => 'text',// 字段名
],
[
'title' => '顔色',
'type' => 'text',
'field' => 'color',
],
[
'title' => '圖檔',
'type' => 'text',
'field' => 'image',
],
],
],
// 更多表單項.....
];
$this->assign($assign);
```