How to populate the datatable from json object with key and value as columns
<p>Normally for populating the Jquery datatable we need to give Json Array (Array of json object) to datatable and map each field with one column. But I have one json object and I want to show all the key in one column and its associated value in next colmn in same row.</p>

<p>For e.g. Sample json :- </p>

<pre><code> {
"first-name": "Tom",
"last-name": "Hanks",
"Designation": "Developer"
 }
</code></pre>

<p>Output table :-</p>

<pre><code>             Key          Value

            first-name    Tom
            last-name     Hanks
            Designation  Developer
</code></pre>

<p>Number of these key and values may vary in future.</p>

<p>One simple way is that I can traverse on object and convert it into array of objects having two attributes and use to populate table.
But I was wondering if there is any other direct way.</p>