I have strings of varying length that I'd like to print in a template as follows:

```
printTemplate = "{0:<5}|{1:<55}|{2:<20}"
print printTemplate.format("ID", "Text", "Category")
    for (docId, text, category) in textList:
        print printTemplate.format(docId, text, category)

```

Which comes out as,

```
ID   |Text                                                   |Category
1500 |Monet is the French painter I have liked the best      |Painting
...

```

The problem is the text strings are sometimes longer than 55 characters, which ruins the formatting. I've tried using TextWrapper,

```
from textwrap import TextWrapper
wrapper = TextWrapper(width=55)
...
        print printTemplate.format(docId, wrapper.fill(text), category)

```

But this doesn't seem to help. An ideas? Thanks!