This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > March 2007 > nested tables?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author nested tables?
yawnmoth

2007-03-31, 7:20 pm

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?

yawnmoth

2007-03-31, 7:20 pm

On Mar 31, 10:10 am, "yawnmoth" <terra1...@yahoo.com> 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?


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...

zzpat

2007-03-31, 7:20 pm

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.
Christopher Night

2007-03-31, 7:20 pm

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
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews