Where can i find the core theme function code (D7)? I would like to use the table theme function as a template for a new theme function I'm writing.
Check out the API Docs on Drupal.org. There you will be able to find the description on how to use the functions as well as the actual code of the function. For your use, here is theme_table(). The actual function is in "includes/theme.inc, line 1631" as stated in the
theme_table() documentation page.
Have a look at themeable functions in the API and more generally you can search for theme_.