Hook_node_view() to print a table?
Your function isn't actually returning anything. So

'#markup' =&gt; print_payment_table()


will result in markup being empty. I've noticed in your function you have a lot of print statements. It would better to build a string variable in your table construction. Like:

$string = "&lt;table&gt;";
$string .= "&lt;tr&gt;&lt;td&gt;".$stuff"&lt;/td&gt;&lt;/tr&gt;";
$string .= &lt;/table&gt;;


then at the end of the function, return $string. 

EDIT: -----------------------
your functions should be seperated, not defined iside of each other.

So:

function table_builder($node){
//do stuff
   return $stuff;
}

function *my_mod*_node_view($node, $view_mode, $langcode){
   $node-&gt;'#markup' .= table_builder($node);
}