使用jquery在单击奇数行时立即展开下一个偶数行

时间:2015-04-03 05:16:51

标签: php jquery html mysql css

我想在此网站中创建表格:

https://www.avast.com/en-in/exploit-protection.php

我尝试使用下面的代码,但是发生了错误,我是jquery的初学者。从mysql php中显示数据来显示。

HTML:

$(document).ready(function(){
    $("#myTable tr:odd").addClass("odd");
    $("#myTable tr:not(.odd)").hide();
    $("#myTable tr:first-child").show();
});

$(document).ready(function(){
    $("#myTable tr").click(function(){
        $(this).next("tr").toggle();
        $(this).find(".arrow").toggleClass("up");
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table id ='myTable' class='tablesorter' style='table-layout:fixed;'>
                            <thead>
                                <tr>
                                    <th class='header' width='4%'>Wild</th>
                                    <th class='header ' width='12%'>Release Date</th>
                                    <th class='header' width='12%'>Exploit Name1</th>
                                    <th data-sorter='false' width='18%'>Name2</th>
                                    <th data-sorter='false' width='53%'>Comments</th>
                                    <th data-sorter='false' width='1%'></th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>								<i hidden>1</i><img src='ex.png' alt='' border=3 height=25 width=25></img>
                                    </td>
                                    <td>03/11/2015</td>
                                    <td><b> CVE-2015-1623</b></td>
                                    <td  style='word-wrap:break-word;'>
                                        <ul>
                                            <li>ABC</li>
                                            <li>XYZ</li>
                                            <li>PQR</li>
                                        </ul>
                                    </td>
                                    <td style='word-wrap:break-word;'>
                                        Microsoft Internet Explorer 11 allows remote attackers to execute arbitrary code or cause ...							
                                    </td>
                                    <td>
                                        <div class='arrow'></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td>
                                        <b>Link: </b>
                                        <ul>
                                            <li><a href =http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1623 target ='_blank'>http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1623<br></a></li>
                                        </ul>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>

请让我知道jquery有什么问题。

0 个答案:

没有答案