Creating Magento Custom Module with Entity table

I was writing a Magento module and trying to create a custom entity table for my Model.  However, every time I run the installation script, it just create table with name t_xxxxxxx  (x is random number) and the associate attribute tables.  Took me so long to figure out that my config.xml was wrong with this format:

<entities>
<foo>
<table>
foo_entity
</table>
</foo>
</entities>

Turn out that is not correct. I need to put the table name right after the <table>


<entities>
<foo>
<table>foo_entity</table>
</foo>
</entities>

Then it create a table with name ‘foo_entity’

FML for spending so much time to figure this out.