title: How to count the number of columns in json file ?
body: <p>I have a json file in my website project,  like this:</p>
  
  <pre><code> [
   {
  "id": "1",
  "name": "ramesh",
  "phone": "12345",
  "salary": "50000"
  },
  
  {
  "id": "2",
  "name": "suresh",
  "phone": "123456",
  "salary": "60000"
   },
  
   {
  "id": "3",
  "name": "mahesh",
  "phone": "123457",
  "salary": "70000"
  }
  ]
  </code></pre>
  
  <p>Here it is the sample data, It has 4 columns but i don't know that my json data which i will get, will have how many number of columns. </p>
  
  <p>I just want to know the number of columns I have in json file. Currently i am creating table like this:</p>
  
  <pre><code> $(document).ready(function () {
          var jsonitems = [];
          $.getJSON("json.json", function (data) {
             var employee_data = '';
              $.each(data, function (key, value) {
                  employee_data += '&lt;tr&gt;';
                  employee_data += '&lt;td&gt;' + value.id + '&lt;/td&gt;';
                  employee_data += '&lt;td&gt;' + value.name + '&lt;/td&gt;';
                  employee_data += '&lt;td&gt;' + value.salary + '&lt;/td&gt;';
                  employee_data += '&lt;td&gt;' + value.phone + '&lt;/td&gt;';
                  employee_data += '&lt;/tr&gt;';
  
              });
              $('#employee_table').append(employee_data);
  
          });
      }); 
  </code></pre>
  
  <p>I have tried toArray(), data[0].columns etc, but not getting this. Please let me know the way to count the columns?
  Thanks for your time.</p>