私はこのCSSスタイルを持っていて、空のhtml表を崩壊/隠すために何を変更する必要があるのか不思議でした。表示するデータがない表を隠す
スタイル:
<style>
#search_settings
{
position:relative;
height:25px;
width:500px;
}
#users_table_results
{
border-collapse:separate;
empty-cells:hide;
}
#events_table_results
{
border-collapse:separate;
empty-cells:hide;
}
#establishments_table_results
{
border-collapse:separate;
empty-cells:hide;
}
</style>
マイHTML:
<div id="search_settings">
<table width="500" border="0">
<tr>
<td height="20" class="heading_text_18">Search results</td>
</tr>
</table>
<table id="users_table_results" max-width="500" name="users" border="0">
<tr>
<td width="50" height="50"><a href="#profile.php"><img src="Images/<?php echo $row_result_users['picture_thumb_url']; ?>"
border="0" height="50" width="50"/></a></td>
<td width="150" class="ordinary_text_12"><?php echo $row_result_users['user_first_name']; ?></td>
<td width="150" class="ordinary_text_12"><?php echo $row_result_users['user_last_name']; ?></td>
<td width="150" class="ordinary_text_12"><?php echo $row_result_users['username']; ?></td>
</tr>
</table>
<table id="events_table_results" width="500" name="events" border="0">
<tr>
<td width="50" height="50"><a href="#profile.php"><img src="Images/<?php echo $row_event['event_thumb_url']; ?>"
border="0" height="50" width="50"/></a></td>
<td width="150" class="ordinary_text_12"><?php echo $row_event['event_name']; ?></td>
<td width="150" class="ordinary_text_12"><?php echo $row_event['event_venue']; ?></td>
<td width="150" class="ordinary_text_12"><?php echo $row_event['event_date']; ?></td>
</tr>
</table>
<table id="establishments_table_results" width="500" name="establishments" border="0">
<tr>
<td width="50" height="50"><a href="#profile.php"><img src="Establishment_Images/<?php echo $row_establishment['establishment_thumb_url']; ?>"
border="0" height="50" width="50"/></a></td>
<td width="150" class="ordinary_text_12"><?php echo $row_establishment['establishment_name']; ?></td>
<td width="150" class="ordinary_text_12"><?php echo $row_establishment['location_name']; ?></td>
<td width="150" class="ordinary_text_12"><?php echo $row_establishment['establishment_pricing']; ?></td>
</tr>
</table>
</div>
私はブランクがありません(それは、このような私のイベントテーブルの結果がない場合は、表が表示されないことを望みますborder = 0のため、イベント結果が存在する検索結果間のスペース)。あなたはテーブル全体を隠すことができますか?
ありがとうございました。私はエコーを使用してテーブルを生成するPHPコードを作ったと私の問題を解決しました –