Hook_node_view() to print a table? I'm working on my first module. What I'd like to do is add this table http://pastebin.com/A1cbya5m function's output to the bottom of nodes. I'm not sure how to do this using hook_node_view()'s '#markup' field. I can do one line but nothing this complicated. I tried doing '#markup' => print_payment_table(), but it didn't work.

Any ideas?
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);
}