I installed dynatable and I wanted to create table from data written in JSON. My table with script:

      <table id="university_Table">
        <thead>
          <th>University</th>
          <th>Link</th>
        </thead>
        <tbody>
        </tbody>
      </table>
    </div>
  </div>
</div>
$(document).ready(function() {
  var json_url = 'universities.json';
  $.getJSON(json_url, function(data) {
    $('#university_Table').dynatable({
      table: {
        defaultColumnIdStyle: 'lowercase'
      },
      dataset: {
        records: JSON.parse(JSON.stringify(data))
      }
    });
  });
});

My Json file looks like this:

[{
  web_page: "http://www.meu.edu.jo/",
  country: "Jordan",
  domain: "meu.edu.jo",
  name: "Middle East University"
},{
  web_page: "http://www.odtu.edu.tr/",
  country: "Turkey",
  domain: "odtu.edu.tr",
  name: "Middle East Technical University"
 },
 //...

This is the result I'm getting on the table:

And this is the result I'm getting on the table

I have followed the documentation on their website, as well as looked at some other posts on stack overflow but the advice they've given hasn't been able to help me with this problem. Any help would be appreciated.

0

There are 0 best solutions below