首页 >后端开发 >php教程 >php动态实现表格跨行跨列实现代码_PHP

php动态实现表格跨行跨列实现代码_PHP

WBOY
WBOY原创
2016-06-01 12:09:10937浏览
复制代码 代码如下:
/*
* author:xudafeng@126.com
* blog:http://www.xdf.me
* date:2012.7.28
*/
class danteng {
function init($col1_name, $col2_name, $col3_name, $time_unit) {
echo "";
}
function baobiao_danteng($name, $time_unit, $pro_name, $pre_name) {
echo "";
for ($i = 0; $i echo "";
for ($j = 0; $j echo "";
for ($i = 0; $i echo "
" . $col1_name . " " . $col2_name . " " . $col3_name . "
$name " . $pro_name[0] . "" . $pre_name . $i . "";
}
echo "
" . $pro_name[($j + 1)] . "" . $pre_name . $i . "";
}
echo "";
}
}
function finish() {
echo "";
}
}
?>

调用方法如下:
复制代码 代码如下:
$init = new danteng();
$init -> init('类型', '项目', '时间单元', $time_num);
$init ->; baobiao_danteng('伏羲', $time_num, $fuxi_pro, 'pre_n');
$init ->; baobiao_danteng('女娲', $time_num, $nvwa_pro, '单元');
$init ->; baobiao_danteng('盘古', $time_num, $pangu_pro, '啊');
$init ->; baobiao_danteng('小冶', $time_num, $pangu_pro, '蛋子');
$init ->; finish();
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn