Create table using for loop in PHP

This is a free and online site where the students who want to build a career in the same profession, can be trained about the working of the PHP.

Perhaps you can go to any of the Php Tutorial where you have to spend a hefty amount also and apart from that you need to give time as well. But here at Phptpoint, we provide functional and easy to understand PHP tutorials for beginners with examples.

Apart from free online tutorial Phptpoint provides you free downloading facility also. Students can easily download free php projects.

Create table using for loop in PHP

<?phpif(isset($_POST['create'])){$rows=$_POST['r'];$cols=$_POST['c'];echo "<table border='1'>";for($i=0;$i<$rows;$i++){echo "<tr>";for($j=0;$j<$cols;$j++){echo "<th>"."r".$i."c".$j."</th>";}echo "</tr>";}echo "</table>";}?><html><body><form method="post"><table width="400" border="1"><tr><td width="177">Enter number of rows </td><td width="207"><input type="text" name="r"/></td></tr><tr><td>Enter number of column </td><td><input type="text" name="c"/></td></tr><tr><td colspan="2"><input type="submit" value="Create Table" name="create"/></td></tr></table></form></body></html>r0c0r0c1r0c2r1c0r1c1r1c2r2c0r2c1r2c2Enter number of rowsEnter number of column

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top 3 Programming Languages to Learn in 2021

Getting Started with Kubernetes | Kubernetes Container Runtime Interface

A Primer to Garbage Collection

Silhouette of a man with a galaxy at its center on a backdrop of stars…

My Software Engineering Journey — Month 1

Open Source UI libraries from our iOS Mobile team

Dart For PHP Developers

Lesson 37: The Selection Sort Algorithm

Kubernetes and Industry use cases

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
sanjeev kumar

sanjeev kumar

More from Medium

Future of Laravel Development and Trends in 2022.

How To Install PHP On Windows OS — 6 Steps To Follow

How To Install PHP On Windows OS

What is PHP?

URLs manipulation in PHP (the easy way)

Change your URLs with a simple fluent PHP class