Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7549241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:54:06+00:00 2026-05-30T09:54:06+00:00

I have a table with expand/collapse div elements in td. When expanding in IE9,

  • 0

I have a table with expand/collapse div elements in td.
When expanding in IE9, all is OK, but in Google Chrome (version 16.0.912.75 m) I get unexpected solid borders on differing spots.
It seems as if the colspan=3 tr’s have something to do with this, as the solid borders appear above and under those. Also, the div width values seem to influence this: the behavior changes when choosing other values for these.

See below html. I added 4screen prints: initial view, expand row1, expand row2, expand both.
What is causing this odd behavior and how can I prevent it?

initial row1 expanded
row2 expanded both expanded

<html>
<head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
    <title>Example</title>
    <style type="text/css">
        table {
            border: solid black 1pt;
            border-collapse: collapse;
            padding: 0;
            border-spacing: 0;
        }

        th {
            background: rgb(255, 255, 153);
            border-style: solid;
            border-color: black;
            border-width: 1pt;
            padding: 0cm 5pt;
            color: black;
            font-family: Verdana;
                font-size: 10pt;
            font-style: normal;
            vertical-align: top;
        }
        td {
            border-style: dotted dotted none none;
            border-color: black;
            border-width: 1pt;
            padding: 0cm 5pt;
            color: black;
            font-style: normal;
            font-family: Verdana;
                font-size: 10pt;
            vertical-align: top;
            margin-bottom: 4.5pt;
            margin-top: 0pt;
        }

        div.QUAL {
            margin-left:4pt;
            font-size: 90%;
        }

        input.buttonQUAL {
            color: blue;
            background: white;
            border: none;
            margin-left:0pt;
            margin-top: 0px;
            margin-bottom: 0px;
            font-size: 100%;
        }

        div.listQUALdesc {
            color: black;
            background: white;
            font-size: 100%;
        }
    </style>
    <script type="text/javascript" language="javascript">
        //expand and collapse functions based on id
        function toggleMe(a){
            var e = document.getElementById(a);
            if(!e) return true;
            if( e.style.display == "none")
                {
                e.style.display = "block"
                }
            else    {
                e.style.display = "none"
                }
            return true;
        };

        function expandByIdStart(IdStart){
            var divs = document.getElementsByTagName('div');
            for (var i=0; i<divs.length; i++) {
                if (divs[i].id.match("^"+IdStart) == IdStart) { 
                    divs[i].style.display = "block";
                }
            }
            return true;
        }

        function collapseByIdStart(IdStart){
            var divs = document.getElementsByTagName('div');
            for (var i=0; i<divs.length; i++) {
                if (divs[i].id.match("^"+IdStart) == IdStart) { 
                    divs[i].style.display = "none";
                }
            }
            return true;
        }
    </script>
</head>
<body>
    <p/>
    <table style='table-layout:fixed word-break:break-all'>
        <col width="70"><col width="70"><col width="70">
        <thead><tr><th>Col1</th><th>Col2</th><th>Col3</th></tr></thead>
        <tbody>
            <tr>
                <td>
                    <input
                        type="button"
                        class="buttonQUAL"
                        onclick="toggleMe('row1'); return true;"
                        onMouseOver="this.style.cursor='hand'"
                        value="row1"/>
                </td>
                <td>text1
                    <div id="row1" class="listQUALdesc" style="width:100; display:none">
                        text2
                    </div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td><div class="QUAL">xxx</div></td>
                <td>text3</td>
                <td></td>
            </tr>
            <tr>
                <td colspan="3">Start</td>
            </tr>
            <tr>
                <td>
                    <input
                        type="button"
                        class="buttonQUAL"
                        onclick="toggleMe('row2'); return true;"
                        onMouseOver="this.style.cursor='hand'"
                        value="row2"/>
                    <div id="row2" class="QUAL" style="display:none;width:65">
                        text5<br/>
                    </div>
                </td>
                <td>text4</td>
                <td></td>
            </tr>
            <tr>
                <td colspan="3">End</td>
            </tr>
        </tbody>
    </table>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:54:08+00:00Added an answer on May 30, 2026 at 9:54 am

    See comments – adding < !doctype html > partly solves the issue

    Addition

    There are some issues to be found on the web that point at an error in Chrome and Safari (which use webkit) like the following: webkit-colspan-table-border-bug.

    It seems that using colspan and bottom-border in combination with border-collapse: collapse leads to border display issues, just as in my example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with expand/collapse javascript acting on the class value assigned to
I have developed a jquery based expand/collapse table with an option of creating new
I want to have a table that the user can expand/contract the contents (but
I have a table defined: <div id=display> <div class=displayRow> <img src=images/expand-arrow.gif class=expandArrow alt=expand> <div
I have a table column I’m trying to expand and hide. jQuery seems to
I have table inside a div tab. The table has 40 rows in it
I'm trying to collapse or expand table rows with + and - sign displayed
How can I make a div container expand its width to contain all its
Is it possible to have a <div> simultaneously (1) not take up all available
I've used the following js code to expand/collapse all nodes of an ASP.Net TreeView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.