title: Creating a formatted table from a list of tuples
body: <p>I have a list of data that looks something like this:</p>
  
  <pre><code>[
      (
          1,
          u'python -c \'print("ok")\'',
          u'data',
          u'python'
      ), (
          2,
          u'python -c \'print("this is some data")\'',
          u'data',
          u'python'
      )
  ]
  </code></pre>
  
  <p>This data is taken out of a database and displayed as this, and is continuously growing. What I would like to do is display the data like this:</p>
  
  <pre><code>Language  |  Type  |   Payload
  -------------------------------
   python   |  data  |  python -c 'print("ok")'
   python   |  data  |  python -c 'print("this is some data")'
  </code></pre>
  
  <p>I have a function that kinda does the same thing, but it's not exactly as expected:</p>
  
  <pre><code>def print_table(data, cols, width):
      n, r = divmod(len(data), cols)
      pattern = "{{:{}}}".format(width)
      line = "\n".join(pattern * cols for _ in range(n))
      last_line = pattern * r
      print(line.format(*data))
      print(last_line.format(*data[n*cols]))
  </code></pre>
  
  <p>How can I get the output of my data to look as wanted? From the answers it's possible with <code>pandas</code> but I would also like a way to do it without installing external modules</p>