473,395 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Build dynamic table with 4 columns at most

228 100+
Hi,

From a database, I need to build a dynamic table that looks like this:

ITEM1 ITEM2 ITEM3 ITEM4
ITEM5 ITEM6

It is dynamic. Sometimes only there could be 1 item or more than 4 items. I have tried 2 loops but it didn't work at all. My main problem is closing and ending the rows. And if the next row is less than 3 item, it is another problem.

Sorry, I don't speak English well.
Nov 24 '10 #1
2 1892
JKing
1,206 Expert 1GB
Use two tables instead.

For example let's say I get lots of orders for items. Each order could potentially have several items. Therefore we should make a table for orders and a table for items and relate them. This way each item would have an order ID. So it doesn't matter how many items you need to store.
Nov 25 '10 #2
samvb
228 100+
Hi,

my problem is not the database design. JUST THE OUTPUT. I mean, how can i display 4 items per row, then open another <tr> for next 3,4 items...
Nov 25 '10 #3

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

Similar topics

1
by: Marty McDonald | last post by:
On my webform I have a table (Table1), nothing in it. In code-behind, I have a method that builds and returns a System.Web.UI.WebControls.Table with rows, columns, & cells. In my aspx.cs...
1
by: Chad Devine | last post by:
Alright, I am posting my solution to a problem I've been having. I have finally found the answer, and it took me a while so I thought I'd provide the final solution here, since it may be benificial...
0
by: spamproof | last post by:
I would like to create a dynamic table in vb.net that will have either editable fields and (most importantly)dropdowns in the cells. I would then like to be able to have a seperate field (outside...
2
by: dschectman | last post by:
This appears to be a feature of IE JavaScript. I am running IE 6.0 with the latest patches from Microsoft. Are there any workarounds other than re-coding the source HTML to place all the...
3
by: C#_learner | last post by:
Hi!!, I have a table which i wanna print. what i wanted to do is, print the header and footer in every new page i am printing. The table which i am getting data is a dynamic table and with...
3
by: BartMan | last post by:
Greetings, I have a gridview which is sitting on a multi view control (witin a view), and it is bound to a dataset which I dynamically apply to the control within asp.net page. The problem is...
5
by: Mr Not So Know It All | last post by:
i was able to add the table via the codebehind to the repeater (itemtemplate). the key was to add it to the container. however, now, the data is repeating itself in each row. can someone help me...
3
by: arunank | last post by:
Hi, The following code for dynamic table creation is not working. Can anyone please help me. The dynamically created rows and columns are not getting populated. CODE: ========= <html>
1
by: thetaamommy | last post by:
Hi : I have a stored procedure which does a crosstab query and builds a table with differing number of columns and differeing columnnames each time. The tablename is static, as i build same...
0
by: gsemailrec | last post by:
On Nov 5, 5:08 pm, thetaamo...@gmail.com wrote: Another way would be to create a link table to an access database. Then write a crosstab query in access which can display a large number of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.