Table with two rows of titles

Discussion in 'HTML' started by Gloops, Jul 4, 2013.

  1. Gloops

    Gloops Guest

    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>
     
    Gloops, Jul 4, 2013
    #1
    1. Advertising

  2. Gloops

    JJ Guest

    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>
     
    JJ, Jul 4, 2013
    #2
    1. Advertising

  3. Gloops

    Gloops Guest

    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.

    --
     
    Gloops, Jul 5, 2013
    #3
  4. 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/
     
    Jukka K. Korpela, Jul 5, 2013
    #4
  5. Gloops

    Gloops Guest

    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.


    --
     
    Gloops, Jul 5, 2013
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stevie_mac

    Tooltips on datagrid titles

    Stevie_mac, Jul 25, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    452
    Stevie_mac
    Jul 25, 2003
  2. Gilgamesh

    Page titles

    Gilgamesh, Dec 5, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    400
    Steve C. Orr [MVP, MCSD]
    Dec 5, 2003
  3. Subba Rao via DotNetMonster.com

    script for moving rows up and down and traverse thru rows of HTML table

    Subba Rao via DotNetMonster.com, Mar 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    8,241
    Subba Rao via DotNetMonster.com
    Mar 19, 2005
  4. PeeBee
    Replies:
    3
    Views:
    5,290
    William F. Robertson, Jr.
    Apr 1, 2005
  5. Rio
    Replies:
    4
    Views:
    1,202
Loading...

Share This Page