9-12
設定列表外觀
- 表格外觀有一定的預設值,若是想自行調整外觀,可以利用設定屬性的方式來進行:
$Model->set_attr('table', ['class' => 'table table-hover table-striped table-sm']);
$Model->set_attr('tr1', ['class' => 'bg-warning white']);
...略...
$ApplyModel->set_attr('table', ['class' => 'table table-hover table-striped']);
$ApplyModel->set_attr('tr1', ['class' => 'bg-success white']);
首頁的列表變這樣:
![](https://campus-xoops.tn.edu.tw/uploads/tad_book3/image/47/火狐截图_2020-06-02T07-14-43.533Z.png)
單一活動頁面的報名列表變這樣:
![](https://campus-xoops.tn.edu.tw/uploads/tad_book3/image/47/火狐截图_2020-06-02T07-15-30.567Z.png)
-
set_attr()
用法可參考:https://campus-xoops.tn.edu.tw/modules/tad_book3/page.php?tbsn=48&tbdsn=1601