Table with two rows of titles

G

Gloops

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

JJ

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

Gloops

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.

--
 
J

Jukka K. Korpela

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

Gloops

Jukka K. Korpela a écrit, le 05/07/2013 07:38 :
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.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top