has an array
$row =array ("username" + "admin" "Mail" = "admin@admin.com" "id" + "1")
I want to output it.
echo "
";echo "
";echo "
".$row['id']." | ";echo "
".$row['username']." | ";echo "
".$row['id']." | ";echo "
";echo "
";
Why is the table messed up? The column widths of each table will change
Reply content:
has an array
$row =array ("username" + "admin" "Mail" = "admin@admin.com" "id" + "1")
I want to output it.
echo "
";echo "
";echo "
".$row['id']." | ";echo "
".$row['username']." | ";echo "
".$row['id']." | ";echo "
";echo "
";
Why is the table messed up? The column widths of each table will change
You don't have to create a new table for every line.
Then fix the style of the watch.
The Foreach loop should be in the table, not outside.
Take a look at the picture you posted, line split line is thicker, row split line is relatively thin, most of it is a table per row
should traverse TR TD
First the landlord your array of writing is not right, should be$row=array("username"=>"admin","mail"=>"admin@admin.com","id"=>"1");
If your array is a one-dimensional array, that's it.
echo "
";echo "
";echo "
".$row['id']." | ";echo "
".$row['username']." | ";echo "
".$row['id']." | ";echo "
";echo "
";
If the array is a two-dimensional array, you should have the Foreach loop misplaced.
For example:
$row=array( array("username"=>"admin","mail"=>"admin@admin.com","id"=>"1"), array("username"=>"uer1","mail"=>"user1@user.com","id"=>"2"), array("username"=>"uer2","mail"=>"user2@user.com","id"=>"3") ); echo "
";foreach ($row as $key => $value) { echo "
"; echo "
".$value['id']" | "; echo "
".$value['username']." | "; echo "
".$value['id']." | "; echo "
";}echo "
";样式: