Calling data into a table with php

Hi guys

im calling data into a table with php, here is what my code looks like


$first = 0;
$second = 1;
$third = 1;


<table width="600" height="309" border="0" align="center">
<tr>
if ($first) {
  echo ('
  <td width="65"><img src="http://www.site.com/test.png" width="65" height="90" /></td>
	  <td width="233" height="92" valign="top">
   	<span class="blue">test</span><br/>
      		<span class="font">some text</span></td>'); }

if ($second) {
  echo ('
    <td width="65"><img src="http://www.site.com/test2.png" width="65" height="90" /></td>
  <td width="219" valign="top">
  <span class="blue">test2</span><br/>
      		<span class="font">some text</span></td>'); }
</tr>
	<tr>

if ($third) {
  echo ('
    <td width="65"><img src="http://www.site.com/test3.png" width="65" height="90" /></td>
  <td width="219" valign="top">
  <span class="blue">test3</span><br/>
      		<span class="font">some text</span></td>'); }

<td width="65"><img src="http://www.site.com/test4.png" width="65" height="90" /></td>
  <td width="219" valign="top">
  <span class="blue">test4</span><br/>
      		<span class="font">some text</span></td>
</tr>
</table>

basically what i want to do is when one table cell is switched off i want the other content to move up into that cell…right now i am getting this

how can i implement this so that the table does not look broken if some cells are set as false in my php

thanks

I am not sure if I understood what you mean exactly but it could be easily managed with left floating DIVs of fixed width or so rather than the table/tr/tds because table cells are not independent they have to be inside TR and to move a cell up means to move the cell to another (previous) TR. So better try to do it with DIVs i.e. when you hide a div then the next div will come up.

thanks…i thought that would be the case :slight_smile: