Collapsible data columns in table using jquery/javascript.

333
November 22, 2016, at 10:03 AM

Table image

As you can see in the image, some of the table data has 2 main columns headers(th) while others have single. I am having trouble creating something for the project where if you click on th all the corresponding td collapses into vertical form (like it does in any accordion but only vertical instead of horizontal).

P.S I have tried creating a little mathematical program where all the corresponding td upon click of the th are highlighted.

Jsfiddle: http://jsfiddle.net/dHKgn/27`

    var colspan = 0;
    var news = 0;
    var stuff = $(this).prevAll("th").each(function () {
        news = $(this).attr("colspan");
        news = parseInt(news);
        colspan = colspan + news;
    })
    indexofthis = parseInt(indexofthis);
    var total = colspan + indexofthis;
    colspan = colspan + 1;
    }
    for (var i = colspan; i <= total; i++) {
        $("td:nth-child(" + i + ")").css({
            "color": "red"
        });
    }
});`
Rent Charter Buses Company
READ ALSO
won&#39;t redirect anymore - 302 status code

won't redirect anymore - 302 status code

Hey guys I got a 302 error code when I want to redirect my page, I'm using header().

354
Getting TypeError when iterating over an object

Getting TypeError when iterating over an object

I am using Rails, and I am getting an error in my jQuery code:.

351
Having multiple countdown timer in javascript with dynamic arguments

Having multiple countdown timer in javascript with dynamic arguments

I have implemented multiple countdown timer by using this jsfiddle link.

502
Passing Array to WebMethod using jquery ajax is not working in asp.net

Passing Array to WebMethod using jquery ajax is not working in asp.net

I am trying to send all gridview records to webmethod using jquery ajax but it is not working. Here is my code.

500