Hiding empty section of a custom content type if field is left empty
If I'm understanding your question correctly, you're testing for a string in $fields['field_text']->content and finding that even when it seems to be blank, it still prints the table.
You might try outputting the contents, like  

var_dump($fields['field_text']-&gt;content);


Perhaps there is some "invisible" content, like 

&lt;p&gt;&lt;/p&gt;


If that's the case, then you could strip that out before testing for the existence of a string in the variable.  

$tmp_content = strip_tags($fields['field_text']-&gt;content,'&lt;p&gt;');
if($tmp_content):
// print table, etc.