JQuery扩展表 - 添加其他列 [英] JQuery Expand Table - adding additional columns

查看:80
本文介绍了JQuery扩展表 - 添加其他列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JExpand并允许我在表中扩展其他行。
我希望这些可扩展行包含与原始表相比的其他列。



我正在使用的表的代码是:示例小提琴: rowspan


I'm using JExpand and allow me to expand additional rows in a table. I'd like these expandable rows to include additional columns compared to the original table.

The code for the table I'm using is : Example Fiddle : http://jsfiddle.net/sB5g9/1/

<body>
    <table id="results" >
        <tr>
            <th>Select</th>
            <th>Population</th>
            <th>Area</th>
            <th>Official languages</th>
            <th>Other</th>
        </tr>
        <tr>
            <td><select name='mode[]' class='mode' /><option value='0:0'></option><option value='1:0'>View</option><option value='2:0'>Additional</option></select></td>
            <td>306,939,000</td>
            <td>9,826,630 km2</td>
            <td>English</td>
            <td>English</td>
        </tr>
        <tr style="background-color:#FFF">  <!-- hidden -->
                    <td><b>Additional Settings</b></td>
                    <td>306,939,000</td>
                    <td>9,826,630 km2</td>
                    <td>English</td>
                    <td>English</td>
        </tr>   <!-- hidden -->
        <tr>
            <td><select name='mode[]' class='mode' /><option value='0:0'></option><option value='1:0'>View</option><option value='2:0'>Additional</option></select></td>
            <td>306,939,000</td>
            <td>9,826,630 km2</td>
            <td>English</td>
            <td>English</td>
        </tr>
        <tr style="background-color:#FFF">  <!-- hidden -->
                    <td><b>Additional Settings</b></td>
                    <td>306,939,000</td>
                    <td>9,826,630 km2</td>
                    <td>English</td>
                    <td>English</td>
        </tr>   <!-- hidden -->
        <tr>
            <td><select name='mode[]' class='mode' /><option value='0:0'></option><option value='1:0'>View</option><option value='2:0'>Additional</option></select></td>
            <td>306,939,000</td>
            <td>9,826,630 km2</td>
            <td>English</td>
            <td>English</td>
        </tr>
        <tr style="background-color:#FFF">  <!-- hidden -->
                    <td><b>Additional Settings</b></td>
                    <td>306,939,000</td>
                    <td>9,826,630 km2</td>
                    <td>English</td>
                    <td>English</td>
        </tr>   <!-- hidden -->

   </table>
</body>

What I currently have is shown below. When you select additional the row is shown and it has the same number of columns as the original table. This can bee seen in the red highlight.

What I would like is to have more columns in the expanded rows as can be seen in the yellow highlight example...

Any idea how I can do this? The expandable rows may include table text fields, dropdown lists etc..

解决方案

When I had a similar requirement I used colspan and rowspan

这篇关于JQuery扩展表 - 添加其他列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆