| | |
dynamic row height
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2006
Posts: 82
Reputation:
Solved Threads: 0
Hi
I am having a problem with the height of my dynamically create rows.
The data is retrived properly form the database, the issue is displaying the rows.
When there are alot of results to dusplay the rows are displayed correctly.
If there are a few rows the hight can be 3 times the height as when there alot of rows.
Note: Below is a simplified version of the code.
I am having a problem with the height of my dynamically create rows.
The data is retrived properly form the database, the issue is displaying the rows.
When there are alot of results to dusplay the rows are displayed correctly.
If there are a few rows the hight can be 3 times the height as when there alot of rows.
Note: Below is a simplified version of the code.
PHP Syntax (Toggle Plain Text)
<?php $query = "SELECT event_id, event_date, event_time FROM cal_appointment WHERE status = 'A' ORDER BY event_date, event_time"; $result = mysqli_query($mysqli, $query) or die('Error, query failed'); /************************ this section displays the events*************************/ echo "<table width=\"100%\" border=\"0\">"; echo"<tr align=\"center\" bgcolor=\"#FFFFFF\">"; echo" <td width=\"100%\" > <div id=\"Layer2\" style=\"position:absolute; width:100%; height:100px; z-index:2; left: 8px; top: 310px;\"> <div id=\"scroll-box2\" style=\"overflow: auto; float: left; width: 100%; height: 240px; margin: 5px; \">\n"; //table begins echo "<table width=\"98%\" height=\"310\" left =\"4\" border=\"0\" font face =\"arial\">\n"; $result = mysqli_query($mysqli,$query) or die('Error, query failed'); $num_rows = mysqli_num_rows($result); for($i=0; $i < $num_rows; $i++) { $row = mysqli_fetch_array($result); list($event_id, $event_date, $event_time) = $row; /**convert 24hr time to 12 hr**/ list($hour, $min, $sec) = split(":",$event_time); if($hour > 12) { $time_hour = $hour - 12; } else { $time_hour = $hour; } //format time of day if($hour < 12) { $tod = "AM"; } else { $tod = "PM"; } $time = "$hour:$min $tod"; echo "<tr>"; echo"<td width=\"18%\" height=\"15\" align=\"center\">$time</td> <td width=\"12%\" height=\"15\">$event_date</td>\n"; echo "</tr>"; }//end for echo "</table>"; echo "</td>"; echo "</tr>"; echo "</div>"; echo "</div>"; echo "</table>"; } ?>
Last edited by assgar; Jul 31st, 2007 at 1:06 pm. Reason: code tags
![]() |
Similar Threads
- Dynamic iframe height (JavaScript / DHTML / AJAX)
- How to add dynamic row in datagrid? (ASP.NET)
- Dynamic iFrame height, not working in ie without refresh. (JavaScript / DHTML / AJAX)
- DataReport Height (Visual Basic 4 / 5 / 6)
- Dynamic iframe height ? (HTML and CSS)
Other Threads in the PHP Forum
- Previous Thread: how to use subform?
- Next Thread: Is there any problem wid ths code?
Views: 1849 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class clean cms code countingeverycharactersfromastring cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail match menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions simple sms soap source space spam speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube






