Here, at phptpoint we begin from the scratch where we can lead you on the practice of these languages.
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
<?php if(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>
r0c0 | r0c1 | r0c2 |
r1c0 | r1c1 | r1c2 |
r2c0 | r2c1 | r2c2 |
Comments
Post a Comment