title: How to build a dynamic html table from json data using node js?
body: <p>There is a small project at nodejs + express + postgres for self-education. By requesting Postgres I get data in json format, then the data on the express tools is rendered to the ejs template. The very question is how do I add this json to a dynamic table in html.</p>
  
  <p>The request to the database looks like this</p>
  
  <pre><code>    const pool = new pg.Pool(config);
  
   router.get('/index', (req, res, next) =&gt; {
      pool.connect(function (err, client, done) {
          if (err) {
              console.log("Can not connect to the DB" + err);
          }
          client.query('SELECT * FROM srt_final WHERE info_init @&gt; \'{"subscriber":"999999"}\' ORDER BY id DESC LIMIT 20', function (err, result) {
               done();
               if (err) {
                   console.log(err);
                   res.status(400).send(err);
               }
               var osaka = result.rows;
  
                       res.render('index', {  srt: osaka });
          })
  
      })
   });
  </code></pre>
  
  <p>The data itself looks like this (about 30 values).</p>
  
  <pre><code>    [
  {"id":11653167,"info_init":
    {"date":"05.07.2018"},
     ....
    {"Time":"10:31:17"}
  },
    ....
  {"id":11653168,"info_init":
    {:},
      ......
    {:}
  }
  ]
  </code></pre>