Jump to content

[SOLVED] Records alignment


sniperscope

Recommended Posts

Hi gurus, can some one tell me(or simply explanation ), how can i display records as below. i could not succeed what ever i done.

<table>
<tr>
   	 <td rowspan="2">RECORD 1</td>
         <td>RECORD 2</td>
         <td>RECORD 3</td>
       </tr>
       <tr>
         <td>RECORD 4</td>
	     <td>RECORD 5</td>
       </tr>
</table>

Link to comment
https://forums.phpfreaks.com/topic/145685-solved-records-alignment/
Share on other sites

Here i solved my problem with my way.

 

Here is the solution. Hope this help to someone who has same problem.

 

Appreciate for any help

Regards

 

<table border="1">
<tr>
<?php
$query = "SELECT * FROM sometable ORDER BY somevalue DESC LIMIT 0, 5";
$r = mysql_query($query, $db_connector) or die(mysql_error());
$row = mysql_fetch_assoc($r);		
$i = 1;			
do{
if($i == 4){
echo "<tr>";
}
?>    
<td <?php if($i == 1){ echo "rowspan=\"2\"";}?>> RECORD 1,2,3</td>
<?php
if($i == 3){
echo "</tr>";	
}
++$i;
} while($row = mysql_fetch_array($r));
?>
</tr>
</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.