html_table関数

html_table 関数:

#カスタム関数 html_table は、配列内のデータを HTML テーブルに入力します。cols 属性は、テーブルの列数を決定します。

table_attr、tr_attr、および td_attr 属性は、テーブル内の tr タグと td タグの追加属性を決定します。

If tr_attr

Trailpad 属性が指定されている場合、一部のデータは最後の行に追加されます。テーブルの最後。

eg:

index.php:
require('Smarty.class .php');
$smarty = 新しい Smarty ;
$smarty->assign('data',array(1,2,3,4,5,6,7,8,9));
$smarty->assign('tr' ,array('bgcolor="skyblue"','bgcolor="#0f0"'));
$smarty->display('index.tpl' );

index.tpl:
{html_table ループ=$data}
{html_table ループ=$data Cols=4 table_attr='border="0"'}
{html_table ループ=$datacols=4 tr_attr =$tr}

出力:

:微信图片_20180313123801.png

学び続ける
||
<?php echo "html_table函数";
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!