VB ASP.Net jQuery:动态更改rowspan

时间:2012-04-13 18:39:45

标签: jquery asp.net vb.net html-table

我有一个jQuery函数,在单击CheckBox时会删除一行。但是,我还需要调整rowspan属性,因为表中的行数现在减少了。我怎么能在jQuery中做到这一点?提前谢谢!

<head runat="server">
    <script src="../../Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script language="javascript"  type="text/javascript">
        $(document).ready(function () {
            $('#chkDebtProtect').click(
                function () {
                    alert("hello world");
                    $('.HideMe').hide();
                });
        });
    </script>
</head>
<body>
<form>
<table>
        <tr  class="tableDataBorder">
            <td rowspan="3" class="leftBorder">
            </td>
            <td rowspan="3" class = "leftMargin">
            </td>
            <td colspan="2" class="TableHeader">
                Online Products
            </td>
        </tr>
           <tr>
                <td colspan="2" class="tableDataBorder">
                    <asp:CheckBox ID="chkProduct" CssClass="boldIt" style="font-size:.8em; font-style: italic" Text="Are you interented in learning about our product?" runat="server" />
                </td>
            </tr>
                <td>
                    Product <br />
                   Info
                </td>
                <td>
                    $&nbsp;<asp:TextBox ID="txtProductPrice" BorderColor="Silver" Width="80" runat="server" BorderWidth="1px" BorderStyle="Inset"></asp:TextBox>.00<br />
                </td>
            </tr>      
</table>
</form>
</body>

1 个答案:

答案 0 :(得分:1)

你试过吗

$("td.leftBorder").attr("rowspan","2");