Table columns rendering

Discussion in 'HTML' started by ami.aga@gmail.com, Jan 20, 2007.

  1. Guest

    I have the following HTML table.
    1st row= 2 cols
    2nd row = 1col
    3rd row = 3 columns

    The first row should spread out across the table with each cell
    occupying half of the coumnspan.
    The code below does not render the 1st row properly.
    help!

    <html>
    <head>
    </head>
    <body>
    <table border="1">
    <tr>
    <td colspan="2">
    abc
    </td>
    <td >
    bcd
    </td>
    </tr>
    <tr>
    <td colspan="3">
    cde
    </td>
    </tr>
    <tr>
    <td>
    def
    </td>
    <td>
    efg
    </td>
    <td>
    fgh
    </td>
    </tr>
    </table>
    </body>
    </html>
     
    , Jan 20, 2007
    #1
    1. Advertising

  2. Ben C Guest

    On 2007-01-20, <> wrote:
    > I have the following HTML table.
    > 1st row= 2 cols
    > 2nd row = 1col
    > 3rd row = 3 columns
    >
    > The first row should spread out across the table with each cell
    > occupying half of the coumnspan.


    No, what it's doing looks right to me. Cells in a column are always
    aligned. In this case since you want to split the width 2 ways at the
    top and 3 ways at the bottom you need 6 (the lowest common multiple of 2
    and 3) columns altogether.

    I suggest make the two cells in the first row colspan="3", give the cell
    in the second row colspan="6", and each cell in the third row
    colspan="2".

    > The code below does not render the 1st row properly.
    > help!
    >
    ><html>
    > <head>
    > </head>
    > <body>
    > <table border="1">
    > <tr>
    > <td colspan="2">
    > abc
    > </td>
    > <td >
    > bcd
    > </td>
    > </tr>
    > <tr>
    > <td colspan="3">
    > cde
    > </td>
    > </tr>
    > <tr>
    > <td>
    > def
    > </td>
    > <td>
    > efg
    > </td>
    > <td>
    > fgh
    > </td>
    > </tr>
    > </table>
    > </body>
    ></html>
    >
     
    Ben C, Jan 20, 2007
    #2
    1. Advertising

  3. schreef:
    > I have the following HTML table.
    > 1st row= 2 cols
    > 2nd row = 1col
    > 3rd row = 3 columns
    >
    > The first row should spread out across the table with each cell
    > occupying half of the coumnspan.

    [snipped]

    That is going to be a very curious table.

    I can understand how you could have 3 columns of data and 1 table-wide
    header

    but I do not understand how you can have a meaningful table with 3
    columns, and then split two headers halfway the 2nd data-column.

    Rob
     
    Rob Waaijenberg, Jan 20, 2007
    #3
  4. Guest

    It worked it worked!!!!
    Thx Ben!!

    Following code works just as I wanted it to!!

    <html>
    <head>
    </head>
    <body>
    <table border="1">
    <tr>
    <td colspan="3">
    abc
    </td>
    <td colspan="3">
    bcd
    </td>
    </tr>
    <tr>
    <td colspan="6">
    cde
    </td>
    </tr>
    <tr>
    <td colspan="2">
    def
    </td>
    <td colspan="2">
    efg
    </td>
    <td colspan="2">
    fgh
    </td>
    </tr>
    </table>
    </body>
    </html>


    On Jan 20, 2:28 pm, Ben C <> wrote:
    > On 2007-01-20, <> wrote:
    >
    > > I have the following HTML table.
    > > 1st row= 2 cols
    > > 2nd row = 1col
    > > 3rd row = 3 columns

    >
    > > The first row should spread out across the table with each cell
    > > occupying half of the coumnspan.No, what it's doing looks right to me. Cells in a column are always

    > aligned. In this case since you want to split the width 2 ways at the
    > top and 3 ways at the bottom you need 6 (the lowest common multiple of 2
    > and 3) columns altogether.
    >
    > I suggest make the two cells in the first row colspan="3", give the cell
    > in the second row colspan="6", and each cell in the third row
    > colspan="2".
    >
    > > The code below does not render the 1st row properly.
    > > help!

    >
    > ><html>
    > > <head>
    > > </head>
    > > <body>
    > > <table border="1">
    > > <tr>
    > > <td colspan="2">
    > > abc
    > > </td>
    > > <td >
    > > bcd
    > > </td>
    > > </tr>
    > > <tr>
    > > <td colspan="3">
    > > cde
    > > </td>
    > > </tr>
    > > <tr>
    > > <td>
    > > def
    > > </td>
    > > <td>
    > > efg
    > > </td>
    > > <td>
    > > fgh
    > > </td>
    > > </tr>
    > > </table>
    > > </body>
    > ></html>
     
    , Jan 20, 2007
    #4
    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. helpful sql
    Replies:
    0
    Views:
    830
    helpful sql
    May 19, 2005
  2. Replies:
    5
    Views:
    612
  3. Replies:
    4
    Views:
    945
  4. Peter Mount
    Replies:
    4
    Views:
    975
    Peter Mount
    Jan 31, 2006
  5. Jacksm
    Replies:
    2
    Views:
    860
    Paul Chalekian
    Nov 21, 2006
Loading...

Share This Page