title: Formatting flask-table output with html on python
body: <p>Not a very experienced user with python here, just picked up python while staying at home. I was looking into integrating the output of flask-table to a website. The following is my python code that creates a simple table for my website. </p>
  
  <pre><code>    from flask_table import Table, Col
  
      app = Flask(__name__)
  
      class ItemTable(Table):
          name = Col('Name')
          description = Col('Description')
  
      Class Item(object):
          def __init__(self, name, description):
              self.name = name
              self.description = description
  
      items = [dict(name='Name1', description='Description1'),
               dict(name='Name2', description='Description2'),
               dict(name='Name3', description='Description3')]
  
      table = ItemTable(items)
  
  
      @app.route("/")
      def hello():
          return render_template('index.html', tStrToLoad=table.__html__())
  
      if __name__ == "__main__":
          app.run()
  </code></pre>
  
  <p>and my html code that takes tStrToLoad from the python code above to display.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Test Flask Table&lt;/title&gt;
          &lt;style&gt;
              body 
              {
                  background-color: #000000;
                  color: #FFFFFF;
                  font-family:Verdana;
                  font-size:16px;
              }
              table, th, td
              {
                  border: 1px solid #0088ff;
                  border-collapse: collapse;
                  padding: 3px;
                  font-family:Verdana;
                  font-size:12px;
                  text-align: left;
              }
  
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          a simple test table
          &lt;br/&gt;&lt;br/&gt;
  
          {{ tStrToLoad }}
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And instead of showing a table with the data, I have the following output in a black background</p>
  
  <pre><code>a simple test table
  
  &lt;table&gt; &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt;&lt;td&gt;Name1&lt;/td&gt;&lt;td&gt;Description1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Name2&lt;/td&gt;&lt;td&gt;Description2&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Name3&lt;/td&gt;&lt;td&gt;Description3&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;
  </code></pre>
  
  <p>Upon further investigating, I did a view page source, this is my actual html code that arises from this.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Test Flask Table&lt;/title&gt;
          &lt;style&gt;
              body 
              {
                  background-color: #000000;
                  color: #FFFFFF;
                  font-family:Verdana;
                  font-size:16px;
              }
              table, th, td
              {
                  border: 1px solid #0088ff;
                  border-collapse: collapse;
                  padding: 3px;
                  font-family:Verdana;
                  font-size:12px;
                  text-align: left;
              }
  
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          a simple test table
          &lt;br/&gt;&lt;br/&gt;
  
          &amp;lt;table&amp;gt;
  &amp;lt;thead&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/thead&amp;gt;
  &amp;lt;tbody&amp;gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Name1&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Description1&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Name2&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Description2&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Name3&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Description3&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
  &amp;lt;/tbody&amp;gt;
  &amp;lt;/table&amp;gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My question is how do I format it correctly in my python script such that it sends <em>&lt;</em> and <em>></em> instead of <em>&amp; lt;</em> and <em>&amp; gt;</em></p>