title: How to create Bootstrap panel based on JSON output
body: <p>I'm trying to generate <code>Bootstrap</code> panel based on <code>JSON</code> output.
  here is my sample <code>JSON</code> output</p>
  
  <pre><code>$valMS = '[
    {
      "Subject": "Test",
      "Message": "rooter",
      "Date": "12-03-17"
    },
    {
      "Subject": "Test",
      "Message": "binu",
      "Date": "12-03-17"
    },
    {
      "Subject": "Test",
      "Message": "cal",
      "Date": "12-03-17"
    },
    {
      "Subject": "Test",
      "Message": "nera",
      "Date": "12-03-17"
    }
  ]';
  </code></pre>
  
  <p>here is I tried <code>JQUERY</code> function</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
      $('body').append('&lt;div class="container" &gt;&lt;/div&gt;&lt;br&gt;');
  
      var html = '&lt;div class="container" &gt;&lt;div class="panel panel-default"&gt;';
      html += '';
      var flag = 0;
  
      var data2   =   &lt;?php echo $valMS; ?&gt;;
      $.each(data2[0], function(index, value){
          html += '&lt;div class="panel-heading"&gt;'+index+'&lt;/div&gt;';
      });
      html += '';
       $.each(data2, function(index, value){
           html += '&lt;div class="panel-body"&gt;';
          $.each(value, function(index2, value2){
              html += ''+value2+'';
          });
          html += '&lt;/div&gt;';
       });
       html += '&lt;/div&gt;';
       $('body').append(html);
       console.log(html);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>According to my code which generates panel like this</p>
  
  <p><a href="https://i.stack.imgur.com/IeCHq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IeCHq.png" alt="enter image description here"></a></p>
  
  <p>But I really need this </p>
  
  <p><a href="https://i.stack.imgur.com/dA5e0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dA5e0.png" alt="enter image description here"></a></p>
  
  <p>What I need to change in my code. How to generate panels for this <code>JSON</code> output. Thank you</p>