sw9 Posted February 28, 2008 Share Posted February 28, 2008 Hi all, I have a webpage that is working great in Firefox and Safari, but when I go to IE (6) it displays my tables on top of each other (of course!). I am not sure if it's in my PHP loop or just a problem with my tables, so I was hoping someone could take a look for me. The page I am talking about is http://www.retn.org/crv.php (please look in Firefox and IE 6 -- not sure if it does it in 7). Below is the code I'm using to generate my tables. The end of the table is at the end of the code, and you can see it's followed by a <br> . So why does IE do this to me? Any way I can resolve it? Thank you very much in advance! <?php // Set the academic year variables so we can get the correct queries $thisYear = date('Y'); $lastYear = date('Y') - 1; $monthStart = '0901'; $monthEnd = '0701'; $firstYear = '1996'; // Start with a FOR loop to set up the proper years, then loop through mySQL results to put them in the right tables for($i=$thisYear;$i>=$firstYear;$i--){ $startDate = $i.'0901'; $endDate = ($i+1).'0831'; // This query takes the above variables from the for loop and determines if a result should go in the current table in the loop. $crv = "SELECT a.episode_name, a.length, a.title, a.acq_date, a.archive FROM mprogram_library AS a LEFT JOIN msn AS b ON (a.title = b.title_num) WHERE a.series_id = '15' AND a.acq_date >= '".$startDate."' AND a.acq_date <= '".$endDate."' GROUP BY a.title ORDER BY a.acq_date DESC"; $rval = mysql_query($crv); $row = 0; $results = mysql_num_rows ($rval); //If there are results, display them, otherwise don't show an empty table. if($results > 0){ ?> <table width="85%" align="left" border="0" cellspacing="0" cellpadding="4"><?php print "<tr><td> </td></tr><td class=\"textboldbig\">".$i." - ".($i + 1)." Academic Year</td></tr>";?> <tr class="textboldbig"> <td nowrap bgcolor="#777257"><span style="color:#FFFFFF">Episode</span></td> <td nowrap bgcolor="#777257"><span style="color:#FFFFFF">Production Date</span></td> <td nowrap bgcolor="#777257"><span style="color:#FFFFFF">Video-On-Demand</span></td> </tr> <?php while( $data = mysql_fetch_assoc( $rval ) ){ //If the video is in the archives, change the text to red. if($data["archive"] == '1'){ $class = "archivebig"; }else{ $class = "schedulelinksbig"; } ++$row; $bgColor = $row % 2 == 0?"#CBC497":"#E4DFC6"; $program_link = "CRV-VOD.php?title=".$data["title"]; print "<tr style=\"background:".$bgColor."\"><td><a href=\"".$program_link."\" target=\"_self\" class=\"".$class."\">".$data["episode_name"]."</a></td> <td><a href=\"".$program_link."\" target=\"_self\" class=\"".$class."\">".retn_date($data["acq_date"])."</a></td>"; //This mySQL statement just checks to see if there is streaming video available. $vid_sql = "SELECT a.title, b.msn_id, b.title_num, b.program_type, b.status, b.filename FROM mprogram_library as a LEFT JOIN msn as b ON (a.title = b.title_num) WHERE b.program_type = 'DV File' AND b.status = 'A' AND a.title =".$data["title"]; $eval = mysql_query ( $vid_sql ); $vidRows = mysql_num_rows($eval); //If there is video available, display "Yes", otherwise display "Not Yet" if ($vidRows > 0){ while ($return = mysql_fetch_assoc ($eval ) ){ ?> <td align="center"><a href="<?php echo $program_link; ?>" class="<?=$class;?>"><?php if ($return["program_type"] == 'DV File' && $return["status"] == 'A') {echo "Yes"; } ?></a></td> <?php } // End WHILE Video Loop }else{ // Else if there is no streaming video, display "Not Yet"?> <td align="center"><a href="<?php echo $program_link; ?>" class="<?=$class;?>">Not Yet</a></td><?php } ?> </tr><?php } // End Main WHILE Loop // HERE IS WHERE I END THE TABLE IN THE LOOP AND THE NEXT ONE WILL START. print "</table><br>"; } // End if results } // End the FOR loop for each academic year ?> Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/ Share on other sites More sharing options...
deansatch Posted February 28, 2008 Share Posted February 28, 2008 Not a php problem. HTML problem. There are several errors in your html. No doctype for a start. You have missed off <tr> in this part of code: </tr></table><br><br><table width="85%" align="left" border="0" cellspacing="0" cellpadding="4"><tr><td> </td></tr><td class="textboldbig">2006 - 2007 Academic Year</td></tr> Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479312 Share on other sites More sharing options...
deansatch Posted February 28, 2008 Share Posted February 28, 2008 Sorry. It's actually this line in your code: print "<tr><td> </td></tr><td class=\"textboldbig\">".$i." - ".($i + 1)." Academic Year</td></tr>";?> should be: print "<tr><td> </td></tr><tr><td class=\"textboldbig\">".$i." - ".($i + 1)." Academic Year</td></tr>";?> Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479323 Share on other sites More sharing options...
sw9 Posted February 28, 2008 Author Share Posted February 28, 2008 deansatch -- thanks for that miss. I did fix that. However, I realized the issue was the table align="left". IE wanted to line all the tables on top of each other and was not acknowledging the br tag. Removing that fixed the problem. Also, thanks for the doctype heads up. My designers made templates for these pages, and I can't believe they left that out. Thank you. sw Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479337 Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 I hate to tell you this, but you need to hire a new designer. You are using tables incorrectly, doctypes are essential, and the align tag has been deprecated. And thats just the tip of the iceburg. If you are paying this person, then stop, and find someone who knows how to write proper code. Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479344 Share on other sites More sharing options...
sw9 Posted February 28, 2008 Author Share Posted February 28, 2008 haku -- thanks. my org is very very small, non profit and pretty much 0 budget. Do you have a good resource link on where to start learning how to properly do this via either css or still using tables? My designer would like to learn. Thanks. Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479348 Share on other sites More sharing options...
premiso Posted February 28, 2008 Share Posted February 28, 2008 CSS is definitely the way to go. As for resources, webmonkey.com is a good one and any book centered around CSS Tables or google search for CSS Tables would be helpful to him. Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479350 Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 Books on CSS are good if he is the reading type. If he isn't, then lynda.com has some good video courses on CSS (its where I first learned) that are a great way to get into CSS. Once he starts, he wont want to stop. Tables are the way of the past. Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479382 Share on other sites More sharing options...
sw9 Posted February 28, 2008 Author Share Posted February 28, 2008 Thank you both very much for your quick responses. The resources you gave are GREAT. Thank you. Link to comment https://forums.phpfreaks.com/topic/93538-table-display-in-ie-php-or-just-a-problem-with-my-tables-help/#findComment-479416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.