html-table-header-is-not-showinh-while-dynamically-adding-row-into-table-in-asp

http://stackoverflow.com/questions/32690243/html-table-header-is-not-showinh-while-dynamically-adding-row-into-table-in-asp

by Taleeb Anwar

HTML

<table class="table table-striped table-bordered " style="width: 100%" id="tblData">
    <thead>
        <tr>
            <th>Item Name</th>
            <th>Item Code</th>
            <th>Quantity</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
</table>

JavaScript

$("#tblData").append('<tr><td><input type="text" class="form-control" value=" selectedText " disabled/></td><td><input type="text" class="form-control" value=" selectedValue " disabled/></td><td><input type="text" class="form-control" value=1 disabled/></td><td><input type="text" class="form-control" value="" disabled/></td><td><buttton class="btn btn-danger remCF" id="btnRemoveId">Remove</button></td></tr>');
//btnRemoveId++;
$("#tblData").on('click', '.remCF', function () {
    $(this).parent().parent().remove();
});