only display if there are items in the table available

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

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>

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

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 8 guests