title: adding table with Django and report lab
body: <p>The following code works for pdf creation, what I wanted is put the data to a table</p>
  <pre><code>def pdf_view(request):
      enc = pdfencrypt.StandardEncryption(&quot;pass&quot;, canPrint=0)
      buf = io.BytesIO()
      c = canvas.Canvas(buf, encrypt=enc)
      width, height = A4
      textob = c.beginText()
      textob.setTextOrigin(inch, inch)
      textob.setFont(&quot;Helvetica&quot;, 14)
      lines = []
      users = User.objects.filter(is_staff=False)
      for user in users:
          lines.append(user.username)
          lines.append(user.email)
          lines.append(user.first_name)
      for line in lines:
          textob.textLine(line)
      c.drawText(textob)
      c.showPage()
      c.save()
      buf.seek(0)
      return FileResponse(buf, as_attachment=True, filename='users.pdf')
  </code></pre>
  <p>I tried to append the data to a table, what I tried is as follows</p>
  <pre><code>def pdf_view(request):
      enc = pdfencrypt.StandardEncryption(&quot;pass&quot;, canPrint=0)
      buf = io.BytesIO()
      c = canvas.Canvas(buf, encrypt=enc)
      width, height = A4
      textob = c.beginText()
      textob.setTextOrigin(inch, inch)
      textob.setFont(&quot;Helvetica&quot;, 14)
      lines = []
      users = User.objects.filter(is_staff=False)
      for user in users:
          lines.append(user.username)
          lines.append(user.email)
          lines.append(user.first_name)
      table = Table(lines, colWidths=10 * mm)
      table.setStyle([(&quot;VALIGN&quot;, (0, 0), (-1, -1), &quot;MIDDLE&quot;),
                      (&quot;ALIGN&quot;, (0, 0), (-1, -1), &quot;CENTER&quot;),
                      ('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black)])
  
      table.wrapOn(c, width, height)
      table.drawOn(c, 0 * mm, 5 * mm)
  
      styles = getSampleStyleSheet()
      ptext = &quot;This is an example.&quot;
      p = Paragraph(ptext, style=styles[&quot;Normal&quot;])
      p.wrapOn(c, 50 * mm, 50 * mm)  # size of 'textbox' for linebreaks etc.
      p.drawOn(c, 0 * mm, 0 * mm)  # position of text / where to draw
      c.save()
      buf.seek(0)
      return FileResponse(buf, as_attachment=True, filename='users.pdf')
  </code></pre>
  <p>This is printing single letter on each row of the table, how I can fix the issue and the data to a simple table, any sot of help is much appreciated.</p>