title: display data in the form of a table using Ajax
body: <p>I have the below code in Ajax to display the data from python stored in MongoDB.</p>
  
  <pre><code>&lt;script&gt;
  function f(){
  $(document).ready(function(){
            $.get('ajax1', function(result){ 
            $.each(result, function(index, element) {
            alert(JSON.stringify(element));
             });
         });
      });
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>Python call for the same:</p>
  
  <pre><code>@route('/ajax1')
  def func():
      client = MongoClient()
      db = client.collection
      result = db.collection.find({},{'_id':0}).limit(2) 
      arr = []
      for document in result:
          arr.append(doc)
  
  
    return (dict(items=arr))
  </code></pre>
  
  <p>I am getting the result as below:
    <code>[{"Name":"abc","Place":"SomePlace","Designation":"des"}]</code>
    <code>[{"Name":"NextName","Place":"NextPlace","Designation":"Nextdes"}]</code></p>
  
  <p>I want to print it in this format or in the form of a table:</p>
  
  <p><code>abc Someplace des</code>
  <code>NextName Nextplace Nextdes</code></p>
  
  <p>Can somebody tell me how to do it? Seems simple but I am unaware of it.
  Thanks!</p>