Blogger Information
Blog 7
fans 0
comment 0
visits 5171
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php--表格生成器
phpcn_u68463的博客
Original
1207 people have browsed it

<?php
header('Content-Type: text/html; charset=utf-8');

echo <<<'INPUT'
<form>
请输入表格的行:<input type="text" name="col">列:<input type="text" name="row">
<button>提交</button>
INPUT;



isset($_GET['row'])?$row = $_GET['row']:$row = '';

isset($_GET['col'])?$col = $_GET['col']:$col = '';

echo '<table border="1" cellpadding="3" cellspacing="0" width="300">';
for ($i=0;$i<$row;$i++){
   echo '<tr>';
   for ($j=0;$j<$col;$j++){
       echo '<td>'.($i*$col+$j).'</td>';
   }
   echo '</tr>';
}
echo '</table>';

/***********作业备注***********/

QQ图片20171227180758_看图王.png


===============运行结果======================

2017-12-27_180542.png

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