Currently I am creating a table through HTML as follows:-
<table class="table table-hover table-responsive">
<thead>
<tr>
<th></th><th>Chamber</th>
<th>Commitee ID</th>
<th>Name</th>
<th>Parent Committee</th>
<th>Contact</th><th>Office</th>
</tr>
</thead>
<tbody>
<tr dir-paginate="user in committee_house|filter:search|itemsPerPage:10" pagination-id="committee_house">
<td>
<div id="favourite_star">
<i class="fa fa-star-o fa-2x favourite_icon" onclick="storeLocally()"></i>
</div>
</td>
<td>{{user.committee_chamber}}</td>
<td>{{user.committee_id}}</td>
<td>{{user.committee_name}}</td>
<td>{{user.committee_parent_id}}</td>
<td>{{user.committee_contact}}</td>
<td>{{user.committee_office}}</td>
</tr>
</tbody>
</table>
<div id="controls" class="controls" align="center">
<dir-pagination-controls pagination-id="committee_house" max-size="5" direction-links="true" boundary-links="true" >
</dir-pagination-controls>
</div>
Currently I am creating everything through HTML. I have dirPagination, search sort and am using a scope variable to store the values in javascript. I want to move this code fully to javascript as I will be needing to create this table again so I want to create a function. Here committee_house is the scope variable. How to do this whole thing in javascript without breaking any functionality.
I tried to put the whole thing in a variable and set the innerHTML of that tag to the variable but it did not work out.
Thanks for any help provided.