Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<table id="employees">
<thead>
  <tr>
    <th>Id</th>
    <th>Name</th>
    <th>Email</th>
    <th>Phone</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>1</td>
    <td>Karthik</td>
    <td>Kk@gmail.com</td>
    <td>1234</td>
  </tr>
  <tr>
    <td>2</td>
    <td>Praveen</td>
    <td>pp@gmail.com</td>
    <td>5678</td>
  </tr>
</tbody>
</table>
 
var heads = [];
$("thead").find("th").each(function () {
  heads.push($(this).text().trim());
});
var rows = [];
$("tbody tr").each(function () {
  cur = {};
  $(this).find("td").each(function(i, v) {
    cur[heads[i]] = $(this).text().trim();
  });
  rows.push(cur);
  cur = {};
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers