Blogger Information
Blog 11
fans 0
comment 0
visits 8001
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
用循环制作表格生成器
PHP小学生
Original
747 people have browsed it
<?php
header('content-type:text/html;charset=utf-8');
echo <<< 'INPUT'
<h3>输入行数和列数,自动生成表格</h3>
<form action="" >
<label>请输入行数:</label><input type="text"  name="tr" placeholder="请输入行数">
<label>请输入列数:</label><input type="text"  name="td" placeholder="请输入列数">
<button type="submit" name="submit">生成表格</button>
</form>
INPUT;

$tr=$_GET['tr'];
$td=$_GET['td'];

echo '<table border="1" cellpadding="3" cellspacing="1">';
for($i=0;$i<$tr;$i++){
    echo '<tr>';
    for($j=0;$j<$td;$j++){
        echo '<td>内容</td>';
    }
    echo '</tr>';
}
echo '</table>';


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post