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.
That would, however, insist that the format has to match the first line of the column. If the case is considered that people may choose the lines of the column they want to print, this shouldn't be done, I think, for columns of type numpy.object etc.
Considering that the format shall match *all* entries, checking the first line could be a performance-optimized guess of consistency, though.