Results 1 to 4 of 4

Thread: [RESOLVED] table colspan not working right

  1. #1

    Thread Starter
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Resolved [RESOLVED] table colspan not working right

    I've discovered something quite odd in IE 9 and FF 10.0.4 if you have this type of a table layout:
    Code:
    <table cellspacing="0" cellpadding="2" border="1">
        <tr>
            <td colspan="2">Column 1 & 2</td>
            <td>Column 3</td>
        </tr>
        <tr>
            <td>Col1</td>
            <td colspan="2">Col 2 & 3</td>
        </tr>
        <tr>
            <td>Col1</td>
            <td colspan="2">Col 2 & 3</td>
        </tr>
        <tr>
            <td>Col1</td>
            <td colspan="2">Col 2 & 3</td>
        </tr>
    </table>
    The result is not at all what you would expect:
    Name:  Table_Columns.png
Views: 1873
Size:  12.8 KB

    Anyone have any idea why the last 3 rows are ignoring the colspan=2 on the 3rd cell?
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: table colspan not working right

    Ok not html-er so i never used colspan.I had to go read what it is.
    Anyhow my guess is that you want the three "col1" 2nd columns cells to be "glued" to the first column ending border.Am i correct?If so here is what i thought could help.If i understood wrong let me know.

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style type="text/css">
        .tbl
        {
            width:100%;
            position:relative;
        }     
        .divm
        {
          width:500px;   
        }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="divm">
       <table cellspacing="0" cellpadding="2" border="1" class="tbl">
        <tr>
            <td colspan="2">Column 1 & 2</td>
            <td style="width:70%">Column 3</td>
        </tr>
        <tr>
            <td>Col1</td>
            <td colspan="2" style="width:99%">Col 2 & 3</td>
        </tr>
        <tr>
            <td>Col1</td>
            <td colspan="2">Col 2 & 3</td>
        </tr>
        <tr>
            <td>Col1</td>
            <td colspan="2">Col 2 & 3</td>
        </tr>
    </table>
        </div>
        </form>
    </body>
    </html>
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: [RESOLVED] table colspan not working right

    Hmmm, interesting.

    It's the
    <td style="width:70&#37;">Column 3</td>
    and
    <td colspan="2" style="width:99%">Col 2 & 3</td>

    lines that do it.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: [RESOLVED] table colspan not working right

    Lol, don't even know what we were talking about here but if you resolved it then i am happy with that.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width