title: Creating a HTML table using data from python lib
body: <p>I want to display data from an xls file into an HTML table. I am using openpyxl to read data from xls file. I used HTML codes to create a table using HTML tags, but I am unable to put data inside the table using variables. I am able to print <code>sheet['A2']</code> and see the value from xls file. I have assigned this value to a variable <code>a2</code>. How can I print the value from this variable inside HTML. More specifically, how can I put the value of variable inside this tag: <code>&lt;tr&gt;&lt;td class="cell"&gt;{%sheet['A2']%}&lt;/td&gt; &lt;td class="cell"&gt;Cell 1.2&lt;/td&gt;&lt;/tr&gt;</code></p>
  
  <pre><code>   import smtplib
     import openpyxl
     from email.mime.multipart import MIMEMultipart
     from email.mime.text import MIMEText
     from email.mime.base import MIMEBase
     from email import encoders
  
     def py_mail(SUBJECT, BODY, TO, FROM):
      """With this function we send out our html email"""
  
  
     book = 
     openpyxl.load_workbook('D:\download\DAILY_PROJECT_REPORT20180420.xlsx')
     sheet = book.active
  
     a2 = sheet['A2']
  
  
  
       # Record the MIME type text/html.
        HTML_BODY = MIMEText(BODY, 'html')
  
       if __name__ == "__main__":
   """Executes if the script is run as main script (for testing purposes)"""
  
       email_content = """
       &lt;head&gt;
       &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
        &lt;title&gt;html title&lt;/title&gt;
        &lt;style type="text/css" media="screen"&gt;
        table {
        border-collapse: collapse;
         }
  
        table, td, th {
        border: 1px solid black;
         border-collapse: collapse;
         border-spacing: 5px;
        }
       &lt;/style&gt;
       &lt;/head&gt;
       &lt;body&gt;
  
      &lt;table style="width:70%"&gt;
         &lt;tr&gt;
      &lt;th&gt; PREPAC &lt;/th&gt;
      &lt;th&gt; TEAM_STATUS &lt;/th&gt;
      &lt;th&gt; TOTAL &lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;&lt;td class="cell"&gt;{%sheet['A2']}%&lt;/td&gt;&lt;td class="cell"&gt;Cell 1.2&lt;/td&gt; 
       &lt;/tr&gt;
       &lt;tr&gt;&lt;td class="cell"&gt;Cell 2.1&lt;/td&gt;&lt;td class="cell"&gt;&lt;/td&gt;&lt;/tr&gt;
  
      &lt;/table&gt;
  
      &lt;/body&gt;
      """
  
       py_mail("Test email subject", email_content, TO, FROM)
  </code></pre>