By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

nested tables?

P: n/a
Say I have a table of products that I sell. There are four columns -
part_number, item_name, item_picture, item_price. The problem is that
I want to group some items in this table together.

For example, say one of the items I sold was a hose by a particular
company and that this hose came in several lengths. In the SQL
database's table, each hose might be in a separate row, however, in
the html table, I'd like them to be associated with one another. ie.
there could be a table in the item_price column, for this particular
row - a table that associates each length with a price.

Unfortunately, this doesn't seem to be very syntactically correct and
I'm not really sure what I can do (I don't really like the idea of
nesting tables, but I also want something that I can turn into the
layout I want with just a little bit of css).

Any ideas?

Mar 31 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Mar 31, 10:10 am, "yawnmoth" <terra1...@yahoo.comwrote:
Say I have a table of products that I sell. There are four columns -
part_number, item_name, item_picture, item_price. The problem is that
I want to group some items in this table together.

For example, say one of the items I sold was a hose by a particular
company and that this hose came in several lengths. In the SQL
database's table, each hose might be in a separate row, however, in
the html table, I'd like them to be associated with one another. ie.
there could be a table in the item_price column, for this particular
row - a table that associates each length with a price.

Unfortunately, this doesn't seem to be very syntactically correct and
I'm not really sure what I can do (I don't really like the idea of
nesting tables, but I also want something that I can turn into the
layout I want with just a little bit of css).

Any ideas?
Two other ideas that occurred to me.

I could create new tables for things I'd like to group together. The
problem with this is that not all items can be grouped together. I
could have tables with a single row (which seems kinda counter
productive) or I could group all the items that aren't otherwise
groupable together. The problem with the latter is that... what if,
in the stylized presentation, I want to have an "item" with multiple
prices between two items with single prices?

Another idea I had was that I could assign each tr to a specific css
class, depending on how it ought to be grouped. The problem with this
is that I'm not sure how I'd go about presenting the items in any
order other then the one the table is in...

Mar 31 '07 #2

P: n/a
yawnmoth wrote:
Say I have a table of products that I sell. There are four columns -
part_number, item_name, item_picture, item_price. The problem is that
I want to group some items in this table together.
It sounds like you want to make a list within a table row.

<td>
<ul>
<li>list item price: </li>
<li>list item price: </li>
<li>list item price: </li>
<li>list item price: </li>
</ul>
</td>

There's nothing with using a table within a table and it's the easiest
to format...I'd use a table.
Mar 31 '07 #3

P: n/a
On Sat, 31 Mar 2007, yawnmoth wrote:
Say I have a table of products that I sell. There are four columns -
part_number, item_name, item_picture, item_price. The problem is that
I want to group some items in this table together.

For example, say one of the items I sold was a hose by a particular
company and that this hose came in several lengths. In the SQL
database's table, each hose might be in a separate row, however, in
the html table, I'd like them to be associated with one another. ie.
there could be a table in the item_price column, for this particular
row - a table that associates each length with a price.

Unfortunately, this doesn't seem to be very syntactically correct and
I'm not really sure what I can do (I don't really like the idea of
nesting tables, but I also want something that I can turn into the
layout I want with just a little bit of css).

Any ideas?
The most syntactically correct way to do this, I believe, is with multiple
TBody elements. This will give you only one level of nesting, however, but
it sounds like that might be enough for you.

-Christopher
Mar 31 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.