Home php教程 php手册 php动态实现表格跨行跨列实现代码

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

Jun 06, 2016 pm 08:36 PM

由于按照条件提取多台服务器生成的报表数据的需要,我们很可能用到php动态生成可以跨行跨列的表格,table跨行跨列杂糅在一起经常出现不好控制,而且行列合并属性

复制代码 代码如下:


/*
* author:xudafeng@126.com
* blog:
* 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();

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)