Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Table with two rows of titles

Reply
Thread Tools

Table with two rows of titles

 
 
Gloops
Guest
Posts: n/a
 
      07-04-2013
Hello everybody,

To present a table with several rows constituting a command, I have six
columns, the two last ones are columns of prices : unit price, and total
price.

So, I feel it could be nice to write "Price" on a first line of title,
and the second line could detail "unit" and "total".

It is easy to have the "Price" label on a line above the other titles,
but I try to have the titles of the other columns about at the level of
the separation between the two lines, "Price" being above that level,
and "unit" and "total" being under it.

This gives complicated sentences, but I suppose it can be understood by
someone who ever saw an invoice in his life.

I tried this, but it does not give good results, the body of the table
is getting far wider, so not aligned with the column headers at all.
Does anybody have a better idea ? I am going to precise colspan="1" for
the first columns, but I fear that will not give anything very concrete.

<thead>
<tr>
<th rowspan="2">
</th>
<th rowspan="2">
lg
</th>
<th rowspan="2">
Ref.
</th>
<th rowspan="2">
Désignation
</th>
<th rowspan="2">
Qte
</th>
<th rowspan="2" colspan="2">
<table>
<tr>
<td colspan="2">Prix</td>
</tr>
<tr>
<td>
Unit.
</td>
<td>
Ttl
</td>
</tr>
</table>
</th>
</tr>
</thead>

 
Reply With Quote
 
 
 
 
JJ
Guest
Posts: n/a
 
      07-04-2013
On Thu, 04 Jul 2013 23:26:33 +0200, Gloops wrote:
> To present a table with several rows constituting a command, I have six
> columns, the two last ones are columns of prices : unit price, and total
> price.
>
> So, I feel it could be nice to write "Price" on a first line of title,
> and the second line could detail "unit" and "total".
>
> It is easy to have the "Price" label on a line above the other titles,
> but I try to have the titles of the other columns about at the level of
> the separation between the two lines, "Price" being above that level,
> and "unit" and "total" being under it.
>
> This gives complicated sentences, but I suppose it can be understood by
> someone who ever saw an invoice in his life.
>
> I tried this, but it does not give good results, the body of the table
> is getting far wider, so not aligned with the column headers at all.
> Does anybody have a better idea ? I am going to precise colspan="1" for
> the first columns, but I fear that will not give anything very concrete.

[snip]

Perhaps you couldn't yet use row & column spanning properly?
Are you looking for something like this?

<table>
<thead>
<tr>
<th rowspan="2"></th>
<th rowspan="2">lg</th>
<th rowspan="2">Ref.</th>
<th rowspan="2">Désignation</th>
<th rowspan="2">Qte</th>
<th colspan="2">Prix</th>
</tr>
<tr>
<th>Unit</th>
<th>Ttl</th>
</tr>
</thead>
</table>
 
Reply With Quote
 
 
 
 
Gloops
Guest
Posts: n/a
 
      07-05-2013
JJ wrote, on 05th July 2013 00:34 UTC + 2 :
> <thead>
> <tr>
> <th rowspan="2"></th>
> <th rowspan="2">lg</th>
> <th rowspan="2">Ref.</th>
> <th rowspan="2">Désignation</th>
> <th rowspan="2">Qte</th>
> <th colspan="2">Prix</th>
> </tr>
> <tr>
> <th>Unit</th>
> <th>Ttl</th>
> </tr>
> </thead>



Oh, nice !

Thank you for such a quick and judicious answer.

--









 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      07-05-2013
2013-07-05 0:26, Gloops wrote:

> So, I feel it could be nice to write "Price" on a first line of title,
> and the second line could detail "unit" and "total".


While this is possible using the technique demonstrated in JJ's reply,
this sounds unnecessarily complicated. Why not use one row of header
cells, the last two being "Unit price" and "Total price"? They are
distinct quantities, and at the same logical level as the header cell
before them, quantity.

The more complicated the table structure is, the more problems it will
cause in accessibility. When each data cell has a single column header
relating to it, access to data via column and row headers will be easier.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
Gloops
Guest
Posts: n/a
 
      07-05-2013
Jukka K. Korpela a écrit, le 05/07/2013 07:38 :
> 2013-07-05 0:26, Gloops wrote:
>
>> So, I feel it could be nice to write "Price" on a first line of title,
>> and the second line could detail "unit" and "total".

>
> While this is possible using the technique demonstrated in JJ's reply,
> this sounds unnecessarily complicated. Why not use one row of header
> cells, the last two being "Unit price" and "Total price"? They are
> distinct quantities, and at the same logical level as the header cell
> before them, quantity.
>
> The more complicated the table structure is, the more problems it will
> cause in accessibility. When each data cell has a single column header
> relating to it, access to data via column and row headers will be easier.
>


That is at least true through SQL, for sure.


--


















 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with printing a bit pattern with printf and %x matt.jaffe@gmail.com C Programming 9 04-19-2013 12:14 PM
table.rows vs. table.getElementsByTagName (+ a regex question) eBob.com Javascript 5 05-20-2008 10:58 AM
script for moving rows up and down and traverse thru rows of HTML table Subba Rao via DotNetMonster.com ASP .Net 0 03-19-2005 06:46 AM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Help ASP; get last inserted value from one table, insert multiple rows in another table. PT ASP General 1 10-07-2004 07:27 AM



Advertisments