More work on printing table

Fixed a repaint exception