dimanche 28 décembre 2014

Create table with javascript array and object


Vote count:

0




i Have 1 array and 1 object;


labels = ['ID','Name']; object = {["id":"1",'name': "richard"],["id":"2",'name': "santos"]};


and i have to create a table like this:



<table>
<thead>
<tr>
<td>ID</td>
<td>Name</td>
</tr>
</thead>
<tbody>
<tr>
<td>Richard</td>
<td>Santos</td>
</tr>
</tbody>


the problem is that:

The "object" variable sometimes could have different key names so i have to create this table dynamically with other objects, im trying to do this all day but no success, can anyone help me? im a "newbee" with javascript. obs: the label and the object vars always have the same size.



asked 46 secs ago







Create table with javascript array and object

Aucun commentaire:

Enregistrer un commentaire