Table/issue 2868

This finishes up @cherti's original PR at #3055 by rebasing on master and updating to work on master.  I also fixed a few bugs and reformatted the code a bit.  After I submit this PR I'm probably going to rebase again to collapse down some of @cherti's original commits, but will still make sure they get credit.
I would suggest to change line 302 to catch the TypeError and raise a ValueError with the same message there.
This way the ValueError is raised for immediate checking and a TypeError is raised in case the column gets printed and we encounter a problem there. As mentioned, I think a TypeError is the better choice if raised by calling the print-function.