Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Tabela + colspan + Firefox 1.5 vs Opera 9.0
Forum PHP.pl > Forum > Po stronie przeglądarki > HTML \ XHTML
KirkoR
Witam!
Mam taki kod:
  1. <table width="100%" cellpadding="0" cellspacing="0" border="1">
  2. <tr>
  3. <td style="background-image: url(/kModule/img/kSkin03.gif); background-repeat: no-repeat;" width="169" height="55"></td>
  4. <td style="background-image: url(/kModule/img/kSkin04.gif); background-repeat: no-repeat;" width="205" height="55"></td>
  5. <td style="background-image: url(/kModule/img/kSkin05.gif); background-repeat: repeat-x; width: auto;" height="55"></td>
  6. <td style="background-image: url(/kModule/img/kSkin05.gif); background-repeat: repeat-x;" width="276" height="55"></td>
  7. <td style="background-image: url(/kModule/img/kSkin06.gif); background-repeat: no-repeat;" width="14" height="55"></td>
  8. </tr>
  9. <tr>
  10. <td style="background-image: url(/kModule/img/kSkin07.gif); background-repeat: no-repeat;" width="169" height="28"></td>
  11. <td style="background-image: url(/kModule/img/kSkin08.gif); background-repeat: no-repeat;" width="205" height="28"></td>
  12. <td style="background-image: url(/kModule/img/kSkin09.gif); background-repeat: repeat-x; width: auto" height="28"></td>
  13. <td colspan="2" style="background-image: url(/kModule/img/kSkin10.gif); background-repeat: no-repeat;" width="290" height="28"></td>
  14. </tr>

Teraz działa w obu przeglądarkach, w momencie kiedy border="0" działa tylko na Operze, na Firefoxie się sypie... sad.gif dlaczego?

Jeśli to komuś pomoże to wystarczyło dodać: <div>&nbsp;</div>
Kod wygląda następująco:
  1. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  2. <tr>
  3. <td style="background-image: url(/kModule/img/kSkin03.gif); background-repeat: no-repeat;" width="169" height="55"></td>
  4. <td style="background-image: url(/kModule/img/kSkin04.gif); background-repeat: no-repeat;" width="205" height="55"></td>
  5. <td style="background-image: url(/kModule/img/kSkin05.gif); background-repeat: repeat-x; width: auto;" height="55"><div>&nbsp;</div></td>
  6. <td style="background-image: url(/kModule/img/kSkin05.gif); background-repeat: repeat-x; width: auto;" height="55"><div>&nbsp;</div></td>
  7. <td style="background-image: url(/kModule/img/kSkin06.gif); background-repeat: no-repeat;" width="14" height="55"></td>
  8. </tr>
  9. <tr>
  10. <td style="background-image: url(/kModule/img/kSkin07.gif); background-repeat: no-repeat;" width="169" height="28"></td>
  11. <td style="background-image: url(/kModule/img/kSkin08.gif); background-repeat: no-repeat;" width="205" height="28"></td>
  12. <td style="background-image: url(/kModule/img/kSkin09.gif); background-repeat: repeat-x;" height="28"></td>
  13. <td colspan="2" style="background-image: url(/kModule/img/kSkin10.gif); background-repeat: repeat-x;" width="290" height="28"></td>
  14. </tr>
my_identify
Przeglądarki pozwalają na okreslenie czy puste komórki mają być wyświetlane, w FF domyslnie nie są, chyba że mają okreslone wymiary. Jest coś takiego jak empty-cells: , ale ja napisałbym to tak:

  1. <table style="width: 100%; border-collapse: collapse; table-layout: fixed;">
  2.  
  3. <tr style="height: 55px;">
  4. <td style="background-color: blue; width: 169px;"></td>
  5. <td style="background-color: red; width: 205px;"></td>
  6. <td style="background-color: white;"></td>
  7. <td style="background-color: green; width: 276px;"></td>
  8. <td style="background-color: red; width:14px;"></td>
  9. </tr>
  10.  
  11. <tr style="height: 28px;">
  12. <td style="background-color: black; width: 169px;"></td>
  13. <td style="background-color: yellow; width: 205px;"></td>
  14. <td style="background-color: pink;"></td>
  15. <td colspan="2" style="background-color: blue; width: 290px;"></td>
  16. </tr>
  17.  
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.