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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.