下面是一个简单的示例代码,用于输出一个包含数据的表格页面:
<!DOCTYPE html>
<html>
<head>
<title>Table Page</title>
<style>
table {
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 5px;
}
</style>
</head>
<body>
<?php
// 假设有一个包含数据的数组
$data = [
['Name', 'Age', 'Email'],
['John Doe', 25, 'john@example.com'],
['Jane Smith', 30, 'jane@example.com'],
['Bob Johnson', 35, 'bob@example.com']
];
// 输出表格
echo '<table>';
foreach ($data as $row) {
echo '<tr>';
foreach ($row as $cell) {
echo '<td>' . $cell . '</td>';
}
echo '</tr>';
}
echo '</table>';
?>
</body>
</html>
这个示例代码会生成一个包含数据的表格页面。你可以根据自己的需求修改数据和样式。
上一篇:php插入图标按钮
下一篇:php dio扩展
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站