Many of the code on the web is wrong, and the script house has been amended.
Copy CodeThe code is as follows:
<title>Two rows of 5 columns altogether 10 data</title>
$num = 5; Currently each row shows the number of columns $k = 1; Initialize while ($k <=10) {if ($k% $num = = 0) {if ($k ==10) {echo '
| '. $k. ' |
'." \ r \ n "; }else{Echo '
| '. $k. ' |
'." \ r \ n "; }} else {echo '
| '. $k. ' | '." \ r \ n "; } $k +=1; Self-added}?>
The following are read from the database:
Copy CodeThe code is as follows:
$sql = "SELECT * FROM table";
$query = mysql_query ($sql);
$num = mysql_num_rows ($query);
for ($i =0; $i < $num; $i + +) {
$result = Mysql_fetch_array ($query);
if ($i%3==0) {
$str. = "";
}
$str. = "". $result [" title "]."";
if (($i + 1)% $num ==0) {
$str. = "";
}
}
?>
http://www.bkjia.com/PHPjc/322763.html www.bkjia.com true http://www.bkjia.com/PHPjc/322763.html techarticle Many of the code on the Web is wrong, and the script house has been amended. Copy the code code as follows: HTML head title two row 5 column total 10 data/title/head Body table border= "1" width=8 ...