Many codes on the Internet are wrong, and this site has specially corrected them.
Copy the code The code is as follows:
Two rows and five columns, a total of 10 data < body>
$num = 5; //The number of columns currently displayed in each row
$k = 1; //Initialization
while($k<=10)
{
if($k % $num == 0){
if($k==10){
echo ''.$k.' td> |
'."rn";
}else{
echo ''.$k.' | '."rn";
}
}
else {
echo ''.$k.' | '."rn";
}
$k+=1; //Add
}
?>