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.
The Python-Doku says "Raised when an operation or function is applied to an object of inappropriate type." for TypeError. The raise of the exception happens if one applies a format string to an object of an inappropiate type (that column).
A ValueError is raised "when a built-in operation or function receives an argument that has the right type but an inappropriate value", which would be technically correct but suggested being misleading by the initial issue description. Therefore it was changed.