Are you using the UVM? There is a uvm_table_printer class to help with this. If not, you should be. :)