473,621 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ 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 1915
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><labe l 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>Colum n 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><labe l 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>Colum n 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
2329
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, ImageViewer.php <?
0
3910
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 redirect the url: http:\name\?param=docId etc. Is it possible
1
6621
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 Response.ContentType = "text/xml" Response.Write "<?xml version='1.0' ?>" dim RS, CN
2
8031
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: fopen(gen_pdf/gen_pdf/yan.pdf) : failed to open stream: No such file or directory in /export/home/.../pdfCov/fpdf.php on line 1698 FPDF error: Unable to create output file: gen_pdf/yan.pdf " I cut and paste the following part of the code into a test.php file and
0
1043
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 of GridView Link column, with a non ..net grid control. the 3rd party grid supports a link column, but the only option there is to enter the link href address. This does not fit very well with asp.net model, and with my design, as i need to load...
3
8070
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
2145
by: Bijender Kumar | last post by:
how to generate dynamic menu hotkey in vb6
8
2652
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 will generate second textbox.then third,forth.... also i have another fields on that page. company name; card type: card Name: pin:
2
1057
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) ------------------------------------------------------------- Private Attributes As New Dictionary(Of String, String) Public Overrides Function GenerateXElement() As XElement Return <DocElement> <InnerElement <%= From Attribute In Attributes Select SomethingHereIGuess...
0
8213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8156
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8653
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8597
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5554
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4065
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2587
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 we have to send another system
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1460
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.