使用Jquery依靠总列和行特定表明智

时间:2014-03-19 10:38:37

标签: jquery

<body>
    <div id="collapseFour" class="accordion-body collapse">
        <div class="accordion-inner">          
            <div class="datagrid divscrollable ">      
                <span>Input Page Design</span>           
                <table id="tblClaimedbyOthers">
                    <thead>
                        <tr>
                            <th class="iconth" width="300px">
                                <button id="btn" type="button" class="btnmergecell imgClass2" style="float: left">Click Here</button>                               
                                <span class="col-center">User</span>
                            </th>                           
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <div class="newscrollClaim ">
                                    <table class="datagrid" id="tbluser">
                                        <thead>
                                            <tr>
                                                <th>
                                                    Column A
                                                </th>
                                                <th>
                                                    Column B
                                                </th>
                                                <th>
                                                    Column C
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr id="1">
                                                <td valign="top">
                                                    <div class="dsbColBgColor">
                                                        <span class="label">David </span>
                                                    </div>
                                                    <div class="dsbColBgColor">
                                                        <span class="label">Daniel </span>
                                                    </div>
                                                    <div class="dsbColBgColor">
                                                        <span class="label">Robin </span>
                                                    </div>
                                                </td>
                                                <td valign="top">
                                                    <div class="dsbColBgColor">
                                                        <span class="label">David</span>
                                                    </div>
                                                    <div class="dsbColBgColor">
                                                        <span class="label">Rose</span>
                                                    </div>
                                                </td>
                                                <td valign="top">
                                                    <div class="dsbColBgColor">
                                                        <span class="label">Daniel </span>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </td>                          
                        </tr>
                    </tbody>
                </table>   
                <span>Output Page Design</span>           
                <table id="tblClaimedbyOthers">
                    <thead>
                        <tr>
                            <th class="iconth" width="300px">                                                         
                                <span class="col-center">User</span>
                            </th>                            
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <div class="newscrollClaim ">
                                    <table class="datagrid">
                                        <thead>
                                            <tr>
                                                <th>
                                                    3[6]
                                                </th>
                                            </tr>
                                        </thead>                                        
                                    </table>                                 
                                </div>
                            </td>                           
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</body>

在这个HTML页面中,我想点击按钮id(btn)上的事件,并且有输出。 我想在下面提到它需要它

在这个html页面中,我想计算特定表id(tbluser)中的所有列数和行数,有三列A,B,C和

  • A栏提3行
  • B栏提2行
  • C栏提1行

我想计算3列中的总列数和行数[6] 如何在jquery中工作?

http://jsfiddle.net/AP2014/q5j9k/1/

0 个答案:

没有答案