only display if there are items in the table available

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: only display if there are items in the table available

Post by seandisanti » Thu Oct 04, 2012 1:05 pm

not going to mess around with your code since i don't have access to any sample data, but personally whenever i want to have something displayed or hidden based on a condition, i use inline css with a condition or ternary expression like this:

Code: Select all


<tr<?php echo ($showthis==1)? '' : echo ' style="display:none;"'; ?>>
	<td> data here </td>
</tr>

***edit*** removed extraneous space in tr tag

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests