如何在表中获得动态可扩展和可折叠的行?

时间:2016-02-05 13:16:56

标签: javascript html css

我正在尝试获取多个添加行:

var rows = $('.qlabs_grid_container tr').length+2;
$(".option1").click(function(){
    // window.location.href="bookappointment.html";
})
$(".additem").click(function(){
    $(".qlabs_grid_container").append('<tr><td class="tablecellbackground"><div class="cells"><div class="denom"><p>10.30am</p></div><div class="cnt"><p>Abhineet Jain</p></div><div class="tots"><p>Hair Coloring</p></div><div class="tots1"><p>2000.00</p></div><div class="recurring"><input type="button" class="recurringpluseminus"><input type="button" class="minusbutton"><input type="button" class="minusbutton1"><input type="text" value="1" style="text-align: center; " id="plusetext1"></div><div class="tots2"><p>3600.00</p></div><td><label class="more" id="m" for="'+rows+'"></label><label class="more1" for="'+rows+'">More Details</label></td></div></td></tr><tr class="expanded"><td colspan="7"><input id="'+ +'" name="#" type="checkbox" class="hideclass"/><div class="expanded"><div class="fortable"><tr><td class="tablecellbackground"><div class="cells"><div class="discountdiv"></div><label class="discount">Discount</label><label class="sub">Sub-total</label><label class="qtyused">Qty Used</label><label class="tax">Tax Type</label><input type="button" class="mulemp"><div class="percentage">10%</div><div class="subtotal">3000.00</div><div class="recurring1"><input type="button" class="recurringpluseminus1"><input type="button" class="minusbuttons"><input type="button" class="minusbutton11"><input type="text" value="1" style="text-align: center; " id="plusetext2"></div><div class="tax1"><p>600.00</p></div><input type="button" class="consume"></div></td></tr></td></tr></div>');   
});   
});

这是我的示例代码。请帮我。

0 个答案:

没有答案