How to Create Tables in PHP: Step-by-Step Guide
In PHP, HTML tags can be used to create and style tables. Here is an example code that demonstrates how to create and style a simple table in PHP:
<!DOCTYPE html>
<html>
<head>
<title>Simple Table Example</title>
</head>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>Email</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
<td>john@example.com</td>
</tr>
<tr>
<td>Jane</td>
<td>30</td>
<td>jane@example.com</td>
</tr>
</table>
</body>
</html>
In the example above, we used HTML tags
, and | to create a table. The border attribute was set to 1 pixel in the
|
---|