Jump to content

add table rows


srinivas6203

Recommended Posts

Hi all

 

I want some add table rows script

 

I want to add rows to the table based on the limit. Meamns there is a input field. If i enter in that field as 3 and click add rows, then 3 rows only will be add. If 2 , 2 rows will be add.

 

Can u send me that script anyone.

 

Thanx

Link to comment
https://forums.phpfreaks.com/topic/96527-add-table-rows/
Share on other sites

ok dokey,

 

it's a little crude but here you go:

 

<html>
<head>
</head>
<body>

<form name="test" method="get" action="<?php echo $PHP_SELF; ?>">
No of Rows: <input type="text" name="no_of_rows"><br/>
<input type="submit" value="Submit">
</form><br />
<?php 
if ($_GET['no_of_rows']) {
$no_of_rows = $_GET['no_of_rows'];
$a = 0;

echo "<table>";
while ($a < $no_of_rows) {
echo "<tr><td>This is row $a</td></tr>";
$a++;
}
echo "</table>";
}
?>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/96527-add-table-rows/#findComment-493994
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.