title: return two lists into html table using tabulate in python
body: <p>I am new with html and I'm trying to display two lists into a table on the html page.</p>
  <p>I can display the lists but can't get them to display as a nice table.</p>
  <p>My code is:</p>
  <pre><code>from tabulate import tabulate 
  
  def some_function(a, b, c)
      cols = ['Col 1', 'Col 2', 'Col3']
      vals = [a, b, c]
      table = [cols, vals]
      table = tabulate(table, tablefmt='html')
      return table
  some_function(1.01, 1.03, 1.05)
  </code></pre>
  <p>This returns the following html code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt;
  &lt;tbody&gt;
  &lt;tr&gt;&lt;td&gt;Col 1&lt;/td&gt;&lt;td&gt;Col 2&lt;/td&gt;&lt;td&gt;Col 3&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;1.01     &lt;/td&gt;&lt;td&gt;1.03      &lt;/td&gt;&lt;td&gt;1.05     &lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I am using Django so I can successfully return the html script to the website with my View but it doesn't read it as code, it appears as a string:</p>
  <p>View:</p>
  <pre><code> def post(self, request):
          form_c = CalculatorForm(request.POST, prefix='form_c')
          try:
              if form_c.is_valid():
                  post = form_c.cleaned_data
                  numbers = some_function(1.01, 1.03, 1.05)
  
          except:
              pass
  
          args = {
              'form_c': form_c, 'form_cols': numbers,
          }
          return render(request, self.template, args)
  </code></pre>
  <p>my html:</p>
  <pre><code>    &lt;div class=&quot;container&quot;&gt;
          {{ form_cols }} # &lt;-- where I want my table
      &lt;/div&gt;
  </code></pre>