473,488 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can i generate dynamic row in PHP

6 New Member
Hi Friends,

i have page with few options. i need to generate multiple rows in page dynamically. in single row i have three labels and three select boxes,
i need to get the number of row to be generated from user and need to generate those. Anyone can help in this issue?

Thanks,
Srikanth
Mar 18 '08 #1
2 1906
myth0s
32 New Member
Hi Friends,

i have page with few options. i need to generate multiple rows in page dynamically. in single row i have three labels and three select boxes,
i need to get the number of row to be generated from user and need to generate those. Anyone can help in this issue?

Thanks,
Srikanth
You can use a loop to create those rows.

[PHP]$myTableRows;

for($i = 0; $i<$nbOfRows; $i++) {
$myTableRows .= '<tr><td><label for="1">L1</label><input id="1" type="checkbox" /></td><td><label for="2">L2</label><input id="2" type="checkbox" /></td><td><label for="3">L3</label><input id="3" type="checkbox" /></td></tr>';
}

// Further....

echo '<table><thead><th><td>Column 1</td><td>Column 2></td><td>Column 3</td></th></thead><tbody>'.$myTableRows.'</tbody></table>';
[/PHP]
Mar 18 '08 #2
Sriku
6 New Member
You can use a loop to create those rows.

[PHP]$myTableRows;

for($i = 0; $i<$nbOfRows; $i++) {
$myTableRows .= '<tr><td><label for="1">L1</label><input id="1" type="checkbox" /></td><td><label for="2">L2</label><input id="2" type="checkbox" /></td><td><label for="3">L3</label><input id="3" type="checkbox" /></td></tr>';
}

// Further....

echo '<table><thead><th><td>Column 1</td><td>Column 2></td><td>Column 3</td></th></thead><tbody>'.$myTableRows.'</tbody></table>';
[/PHP]
Thanks Buddy.
Srikanth
Mar 20 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2321
by: Rithish | last post by:
I have a set of images on a server. I want to pick these from the database without creating a temporary file on the server; and also have some text alongwith it. Something like, ...
0
3900
by: timothy ma and constance lee | last post by:
sir I need to have an xslt to generate the dynmaic drop down list. The size is detetmined by the a para in xml. Inside the drop list, when the index is onclick, it will have java script to...
1
6612
by: Robson Carvalho Machado | last post by:
Dear Friends, I was using the below code in ASP to dynamically generate XML from a SQL Query Does anyone knows how can I migrate this code to VB and ASPX? Regards Robson Machado ...
2
8021
by: yanlu06 | last post by:
I tried to use HTML2FPDF to generate dynamic local files and save the generated files on the server. I don't know why it gives me the following error message: " Warning:...
0
1036
by: sonic | last post by:
I am working with a 3rd party control that does not follow the asp.net event model. I would like to make it post to current page, and fire a server side event. I would like to mimic the behavior...
3
8066
by: sureshgv | last post by:
i want to generate report dynamically in the formate select * from table where month=m and year =y How to do this ?very urgent..please help me
1
2140
by: Bijender Kumar | last post by:
how to generate dynamic menu hotkey in vb6
8
2633
by: sejal17 | last post by:
hello everyone, I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it...
2
1050
by: Rory Becker | last post by:
I need to generate an XElement with an indeterminate number of attributes whose names and values will have previously have been added to a dictionary(Of String, String) ...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.