separated table printing into separate module
fixed bug when not printing table with header