TD formatting not showing up in IE7

Reply

Join Date: Jul 2005
Posts: 18
Reputation: arrbug is an unknown quantity at this point 
Solved Threads: 0
arrbug arrbug is offline Offline
Newbie Poster

TD formatting not showing up in IE7

 
0
  #1
Sep 24th, 2009
Hi all. I'm having a problem in that I can't get the table cell text OR the background to center in IE7. Works fine in Mozilla. Text-align is set to left on one of the contianing divs but that doesn't seem to affect it.

CSS
HTML and CSS Syntax (Toggle Plain Text)
  1. .browseCategoryImage {
  2. background: #FFF url( 'images/browsecategorybg.png' ) no-repeat center center;
  3. vertical-align:top;
  4. height: 200px;
  5. text-align:center;
  6. }

PHP
HTML and CSS Syntax (Toggle Plain Text)
  1. <?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
  2. mm_showMyFileName(__FILE__);
  3.  
  4. $iCol = 1;
  5. if( !isset( $categories_per_row )) {
  6. $categories_per_row = 3;
  7. }
  8. $cellwidth = intval( 100 / $categories_per_row );
  9.  
  10. if( empty( $categories )) {
  11. return; // Do nothing, if there are no child categories!
  12. }
  13. ?>
  14. <br/>
  15. <table width="100%" cellspacing="0" cellpadding="0">
  16. <?php
  17. foreach( $categories as $category ) {
  18. if ($iCol == 1) { // this is an indicator wether a row needs to be opened or not
  19. echo "<tr> \n";
  20. }
  21. ?>
  22.  
  23. <td class="browseCategoryImage" width="<?php echo $cellwidth ?>">
  24. <br />
  25.  
  26.  
  27.  
  28. <a class="browseCategoryTitle" title="<?php echo $category["category_name"] ?> " href="<?php $sess-> purl(URL."index.php?option=com_virtuemart&amp;page=shop.browse&amp;category_id=".$category["category_id"]) ?>">
  29. <?php
  30. if ( $category["category_thumb_image"] ) {
  31. echo ps_product::image_tag( $category["category_thumb_image"], "alt=\"".$category["category_name"]."\"", 0, "category");
  32. echo "<br /><br/>\n";
  33. }
  34. echo $category["category_name"];
  35. echo $category['number_of_products'];
  36. ?>
  37. </a><br/>
  38. </td>
  39.  
  40.  
  41. <?php
  42. // Do we need to close the current row now?
  43. if ($iCol == $categories_per_row) { // If the number of products per row has been reached
  44. echo "</tr> \n";
  45. $iCol = 1;
  46. }
  47. else {
  48. $iCol++;
  49. }
  50. }
  51. // Do we need a final closing row tag?
  52. if (sizeof( $categories ) < $categories_per_row) {
  53. echo "</tr>\n";
  54. }
  55. ?>
  56. </table>
Last edited by arrbug; Sep 24th, 2009 at 7:40 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: TD formatting not showing up in IE7

 
0
  #2
Sep 26th, 2009
- Alignment is not inherited from div to table. You need to apply the style to the td tags.

- The php script may be overriding the style.

- If there is any syntax error in the style, the entire style becomes invalid in some browsers. You have syntax errors, because you have attributes without parameters in the background style.

Wrong:

no-repeat

Right:

background-repeat="no-repeat"
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz

Re: TD formatting not showing up in IE7

 
0
  #3
Sep 27th, 2009
Originally Posted by MidiMagic View Post
- Alignment is not inherited from div to table. You need to apply the style to the td tags.

- The php script may be overriding the style.

- If there is any syntax error in the style, the entire style becomes invalid in some browsers. You have syntax errors, because you have attributes without parameters in the background style.

Wrong:

no-repeat

Right:

background-repeat="no-repeat"
Sorry for interference, but you'll have to correct this!

There's nothing wrong with his shorthand background css statement:
background: #FFF url( 'images/browsecategorybg.png' ) no-repeat center center; In fact it is absolutely correct and how shorthand background statements work.
But, there is more than one error in your sugestion:
cite: background-repeat="no-repeat"
1. The "=" mark is not allowed as css property/value delimiter;
2. the (") quotation marks in the property value, neither.

This syntax is not allowed on html element inline style attribute declarations, either.
Last edited by Troy III; Sep 27th, 2009 at 10:30 am.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC