2 Replies Latest reply on Feb 26, 2010 12:59 PM by ThusSpakeZarathustra

    table question

    ThusSpakeZarathustra Level 1

      I have no idea where to post a question like this, but here goes:

       

      I want to create a table like this.

       

       

      Header 1

      Header 2

      Header3

      Sub H A1

      Sub HA2

      Sub H B1

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data

      Data


      here is some example code for a table to use for discussion:

      <TABLE border="1"
                summary="This table gives some statistics about fruit
                         flies: average height and weight, and percentage
                         with red eyes (for both males and females).">
      <CAPTION><EM>A test table with merged cells</EM></CAPTION>
      <TR><TH rowspan="2"><TH colspan="2">Average
          <TH rowspan="2">Red<BR>eyes
      <TR><TH>height<TH>weight
      <TR><TH>Males<TD>1.9<TD>0.003<TD>40%
      <TR><TH>Females<TD>1.7<TD>0.002<TD>43%
      </TABLE>
      

      tableEx.gif

      I can get rid of the Male Female Headings

      tableEx2.gif

      Which, of course, doesn't get me what I want as per top (large) table.

      Why is there an empty cell at the header level? What part of the code put it there?

      How do I get rid of  it and properly place the data? I don't want to hide empty cells.

       

      I had this problem before, figured it out, and promptly forgot the solution. I am, obviously, relatively new to web programming.

       

      Any help is appreciated.

        • 1. Re: table question
          Wynnefield

          I am not sure of the result you are trying to achieve unless you wish to just eliminate the first column from the second example (gray table). If so, just deleting the first <th> tag from the first, third and fourth rows <tr>.

           

           

          This should cause the data cells in the third table to shift one to the right and the empty cell to go away. However, I am still not sure if this is what you want, as you first sample table does not appear to match your coded versions, i.e. Header1; Header2-Sub1-Sub2; Header3-Sub1. Anyway, I hope it helps you get where you need.

          • 2. Re: table question
            ThusSpakeZarathustra Level 1

            Hi,

            Missed the one in the first line. Still getting used to the formatting. Thanks for being nice enough to take the time to answer one of the dumbest questions I've ever asked. I'd plead that I'm teaching myself all the web (php, jscript,css) at once but even that can't defend this one.

             

            Appreciate it!