title: python HTML for loop format
body: <p>I want to make the code below to get formatted as HTML. However I'm having problem formatting it as HTML.</p>
  
  <pre><code>cur.execute("SELECT Statement")
  
  rows = cur.fetchall()
  
      html = """\
      &lt;table border='1'&gt;
      &lt;tr&gt;&lt;th&gt;Date&lt;/th&gt;&lt;th&gt;DPC&lt;/th&gt;&lt;th&gt;TOTAL&lt;/th&gt;&lt;th&gt;Success&lt;/th&gt;&lt;/tr&gt;
      &lt;tr&gt;
      for row in rows:
          for col in row:
              print "&lt;td&gt;"
              print "%s".replace(" ", "") % col
              print "&lt;/td&gt;"
              print "&lt;/tr&gt;"
          &lt;/table&gt; 
      """
  </code></pre>
  
  <p>My goal is to make it html output, however I don't know how to make the for loop output as formatted html.</p>