This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to create dynamic rows and columns in HTML tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to create dynamic rows and columns in HTML tables" Watch "How to create dynamic rows and columns in HTML tables" New topic
Author

How to create dynamic rows and columns in HTML tables

Nagaraju Mulinti
Ranch Hand

Joined: Aug 10, 2008
Posts: 37
Hi All,

I need to create rows and columns dynamically in HTML tables. I am not sure how to proceed to create dynamically. Can you please help me in this regards and also provide specific code if possible as I am not much more familiar with HTML.


Thanks in advance..!
samir singha
Greenhorn

Joined: Mar 17, 2008
Posts: 23
<TR> tag creates row in a table and </TR> ends the row in html. similarly, <TD> creates a column and </TD> ends a column. You can use two for (or any other loops) to create rows and columns dynamically. For example,

<tr>
<td>column 1</td>
<td>column2</td>
</tr>

will create 1 row and two columns. Try to implement it with loop to create as many as rows any columns you want to create dynamically.
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
If Samir's answer fulfills your request then it's good else if you want to do this on the client side, it would be a different story altogether. JavaScript would be used.


Experience and talent are independent of age
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create dynamic rows and columns in HTML tables
 
Similar Threads
Dynamically adding columns and rows to JTable using AbstractTableModel
Add row dynamically in html table based on the number of records in the database using jsp
Rounded corner Tables
Table Question
Creating a dynamic table