Categories > TinyButStrong general >

How to 'not show' table when no data in block

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Col
Date: 2005-02-07
Time: 05:33

How to 'not show' table when no data in block

My HTML code looks like this:
<table>
  <tr>
    <td><b>Column 1</b></td>
    <td><b>Column 2</b></td>
    <td><b>Column 3</b></td>
  </tr>
  <tr>
    <td>[blk.col1;block=tr]</td>
    <td>[blk.col2]</td>
    <td>[blk.col3]</td>
  </tr>
</table>

When blk is empty I don't want any of the table to appear (currently the headings still appear). How do I do that? Thanks in advance for any advice.
By: Skrol29
Date: 2005-02-07
Time: 10:32

Re: How to 'not show' table when no data in block

Hello,

You can get first the number of row using MergeBlock() directly, or if you know it before the merge, you can avoid the merge. Then you use the number of row on a field with parameter 'magnet' to deleted or keep the table.

Php:
$nbr = $TBS->MergeBlock('blk',...);
$nbr = ($nbr==0)  ? '' : ' ';
Html:
<table>  [var.nbr;magnet=table]
...
</table>