jkkenzie Posted October 8, 2009 Share Posted October 8, 2009 Am using <div style="overflow: auto; width: 100%; height: 100%"> to display data from php results. Is it possible to say which COLUMNS to FREEZE (So that they are not scrolling when the horizontal scrool bar is scrolled) within the following code: <div style="overflow:auto; width:100%; height:100%"> <table width="100%" border="0" cellspacing="1" cellpadding="8" class="avn"> <tr> <td class="titles"> Date </td> <td class="titles">Identification</td> <td class="titles">Account_Number</td> <td class="titles">First_Name</td> <td class="titles">Middle_Name</td> <td class="titles">Last_Name</td> <td class="titles"> Address </td> <td class="titles">Cert_Number</td> <td class="titles">SUM_Total_Amount</td> <td class="titles">Rounded_Down_Amount</td> <td class="titles">Total_Shares</td> <td class="titles">Rounded Down Shares</td> <td class="titles">Ones</td> <td class="titles">Tens</td> <td class="titles">Hundreds</td> <td class="titles">Thousands</td> <td class="titles">Ten_Thousands</td> <td class="titles">Hundred_Thousands</td> <td class="titles">Millions</td> <td class="titles">Ten_Millions</td> <td class="titles"><div align="center">Preview</div></td> <td class="titles"><div align="center">Cert</div></td> </tr> <tr> <?php $Recx=0; do{ $query_rs_events = "SELECT Id, Pk, SUM(Amount) as Total FROM shares WHERE NOT(Description='Safaricom Corporate') AND shares.Amount>'19999' AND Id='".$row_rs_x['Id']."'"; $rs_events = mysql_query($query_rs_events, $app_conn) or die(mysql_error()); //$totalRows_rs_events = mysql_num_rows($rs_events); do{ if(mysql_num_rows($rs_events)>0){ if($row_rs_events['Total']>19900){ $query_rs_mem = "SELECT RecID, ID_Number, Emo_Number, First_Name, Middle_Name, Last_Name, Address FROM members WHERE ID_Number='".$row_rs_events['Id']."'"; $rs_mem = mysql_query($query_rs_mem, $app_conn) or die(mysql_error()); $row_rs_mem = mysql_fetch_assoc($rs_mem); $perval=floor($row_rs_events['Total']/20000); $val= floor($row_rs_events['Total']); //Split into Number Positioning = tens, hundreds.... $parts = array(); $div = pow(10, strlen($perval) - 1); $n = $perval; while ($div >= 1) { $parts[$div] = (int) ($n / $div) * $div; $n = $n % $div; $div /= 10; $count==0; $count++; $m=$count%2; if ($m==0) { echo '<tr class="cms_cont1">'; } else{ echo '<tr class="cms_cont">'; } } ?> <td valign="top" class="avn2"> <?php echo date('d-m-Y');?></td> <td valign="top" class="avn2"> <?php echo $row_rs_mem['ID_Number'];?></td> <td valign="top" class="avn2"> <?php echo $row_rs_mem['Emo_Number']; ?></td> <td valign="top" class="avn2"> <?php echo $row_rs_mem['First_Name']; ?></td> <td valign="top" class="avn2"> <?php echo $row_rs_mem['Middle_Name']; ?></td> <td valign="top" class="avn2"> <?php echo $row_rs_mem['Last_Name']; ?></td> <td valign="top" class="avn2"> <?php echo $row_rs_mem['Address'];?></td> <td valign="top" class="avn2"> <?php echo $row_rs_events['Pk']; ?></td> <td valign="top" class="avn2"> <?php echo $row_rs_events['Total']; ?></td> <td valign="top" class="avn2"> <?php echo convert_number($val); ?></td> <td valign="top" class="avn2"> <?php echo $row_rs_events['Total']/20000; ?></td> <td valign="top" class="avn2"> <?php echo floor($row_rs_events['Total']/20000); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[1]); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[10]); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[100]); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[1000]); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[10000]); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[100000]); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[1000000]); ?></td> <td valign="top" class="avn2"> <?php echo convert_number($parts[10000000]); ?></td> <td align="center" valign="top" class="avn2"><div align="center"><a href="preview.php?id=<?php echo $row_rs_mem['RecID']; ?>"> <?php $var3=$row_rs_mem['RecID']; if ($var3=="") { echo ""; } else{ echo "<img src=\"pix/view.gif\" align=\"middle\" border=\"0\">"; } ?> </a></div></td> <td align="center" valign="top" class="avn2"><div align="center"><a href="cert.php?id=<?php echo $row_rs_mem['RecID']; ?>"> <?php $var3=$row_rs_mem['RecID']; if ($var3=="") { echo ""; } else{ echo "<img src=\"pix/remove.gif\" align=\"middle\" border=\"0\">"; } ?> </a></div></td> </tr> <?php } } }while($row_rs_events = mysql_fetch_assoc($rs_events)); }while($row_rs_x = mysql_fetch_assoc($rs_x)); ?> </table> </div> Quote Link to comment Share on other sites More sharing options...
haku Posted October 8, 2009 Share Posted October 8, 2009 No. Quote Link to comment Share on other sites More sharing options...
jkkenzie Posted October 8, 2009 Author Share Posted October 8, 2009 It is possible: I cuptured the values to be used first, Like this: <?php $Recs[$Recx]=$row_rs_mem['RecID']; //echo $Recx; $Recx++; ?> Then Used the values in the next TD => TABLE Like this: <TD valign="top"> <table width="100%" border="0" cellspacing="1" cellpadding="1" class="avn"> <tr> <td class="titles"><div align="center">Preview</div></td> <td class="titles"><div align="center">Cert</div></td> </tr> <?php $RecsXY=0; while($RecsXY<$Recx){ $count2==0; $count2++; $m2=$count2%2; if ($m2==0) { echo '<tr class="cms_cont1">'; } else{ echo '<tr class="cms_cont">'; } ?> <td align="center" class="avn2" ><div align="center"><a href="preview.php?id=<?php echo $Recs[$RecsXY]; ?>"> <?php $var3=$Recs[$RecsXY]; if ($var3=="") { echo ""; } else{ echo "<img src=\"pix/view.gif\" align=\"middle\" border=\"0\">"; } ?> </a></div></td> <td align="center" class="avn2" ><div align="center"><a href="cert.php?id=<?php echo $Recs[$RecsXY]; ?>"> <?php $var3=$Recs[$RecsXY]; if ($var3=="") { echo ""; } else{ echo "<img src=\"pix/remove.gif\" align=\"middle\" border=\"0\">"; } ?> </a></div></td> </tr> <?php $RecsXY++; } ?> </table> </TD> THE PROBLEM IS , ITS DIFFICULT TO MAKE BOTH THE ROWS' CELLS ON BOTH TABLES TO HAVE EXACTLY EQUAL HEIGHT AND WIDTH DUE TO CONTENTS OR VALUES THE GET INSIDE THE CELLS.......... ANY IDEA??????? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.