PHP Basics

Create Table in webpage using PHP Code

The power of PHP is it can easily embed HTML Codes. To create any html elements lets say a table, we can use PHP to create a table.

Create Table Using PHP

We have to echo out all the table tags and its respective data.

Note: If you are looking for a solution to create a table inside mysql using PHP, then check this article: Use SQL in PHP






$output.=”<tr><td>Simran</td><td>113400</td><td>Asst. Engineer</td></tr>”;

$output.=”<tr><td>Raju</td><td>112000</td><td>Plan Executor</td></tr>”;



echo $output;



Sures 112000 Engineer
John 142000 Contractor
Simran 113400 Asst. Engineer
Raju 112000 Plan Executor
Sneha 182000 Architecture