Hiding empty section of a custom content type if field is left empty I am relatively new to Drupal so I need someone to school me here.

I have created a custom theme and using theme key to attach it to a new content type (HTML Email). It roughly has about 12 sections consisting of a header graphic and a text area.

I’ve created a view and added all the fields to it displaying as a block in my custom theme using the views-view-fields—[name].tpl.php. 

It displays perfectly but my issue is not all the section of the content type will be used so If the text area in a section is left blank I want that section not to show up in the block.

Below doesn't seem to work

&lt;? if ($fields['field_text']-&gt;content): ?&gt;
     &lt;table border="0" cellpadding="5" cellspacing="0" width="100%"&gt;
        &lt;tr&gt;
           &lt;td&gt;&lt;?php print $fields['field_header']-&gt;content; ?&gt;&lt;/td&gt;
       &lt;/tr&gt;
       &lt;tr&gt;
         &lt;td valign="top" style="padding:5px 20px"&gt;&lt;?php print $fields['field_text']-&gt;content; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;? endif; ?&gt;
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.