Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][CSS]Style tabeli, Prosze o pomoc
Darou
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 28.01.2008

Ostrzeżenie: (0%)
-----


Witam mam problem otóż
Chciałem zrobić ładną tabele pasującą mi do wyglądu strony
Tak więc:
W sekcji <head> mam link do styli wygląda to tak
  1. <link rel="stylesheet" type="text/css" href="style.css" />

Tabela wygląda tak:
  1. <table summary="Tabela testowa" id="tabela" width="90%">
  2. <tr>
  3. <td class="gora" align="center"><font style="font-size: 9pt">Przedmiot</font></td>
  4. <td class="gora" align="center"><font style="font-size: 9pt">Finalista</font></td>
  5. <td class="gora" align="center"><font style="font-size: 9pt">Laureat</font></td>
  6. </tr>
  7. <tr>
  8. <td><font face="Tahoma" style="font-size: 9pt">Chemia</font></td>
  9. <td align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>


A w pliku style.css:
Kod
#tabela {
     border: 1px solid white;
     border-collapse: collapse;
     background-color: eeeeee;
  }
  #tabela td {
     border: 1px solid white;
     padding: 3px;
  }
  td.gora {
     color: white;
     background-color: 1f9ae7;
  }
  td.2 {
     background-color: fafafa;
  }

Jeśli otwieram w przeglądarce wyskakuje mi zwykła tabela bez obramowanie natomiast jeśli otwieram to w edytorze wysiwyg
widać tak jak chce wszystko.
Moje pytanie brzmi co jest przyczyną ?


//
MMMmm. Dzięki (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) )

Ten post edytował Darou 2.06.2008, 18:03:48
Go to the top of the page
+Quote Post
Crozin
post
Post #2





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Kolory zapisujemy jako #XXXXXX (hash na początku)
Go to the top of the page
+Quote Post
Darou
post
Post #3





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 28.01.2008

Ostrzeżenie: (0%)
-----


Jeszcze jedno pytanie.
To mój styl css:

Kod
#tabela {
   border: 1px solid white;
   border-collapse: collapse;
   background-color: #eeeeee;
}
#tabela td {
   border: 1px solid white;
   padding: 3px;
}
td.gora {
   color: white;
   background-color: #1f9ae7;
}
td.2 {
   background-color: #fafafa;
}


Tu tabela:
  1. <p align="center">
  2. <div align="center">
  3. <table summary="Tabela testowa" id="tabela" width="90%">
  4. <tr>
  5. <td class="gora" align="center"><font style="font-size: 9pt">Przedmiot</font></td>
  6. <td class="gora" align="center"><font style="font-size: 9pt">Finalista</font></td>
  7. <td class="gora" align="center"><font style="font-size: 9pt">Laureat</font></td>
  8. </tr>
  9. <tr>
  10. <td><font face="Tahoma" style="font-size: 9pt">Chemia</font></td>
  11. <td align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  12. <td align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  13. </tr>
  14. <tr>
  15. <td class="2"><font face="Tahoma" style="font-size: 9pt">Chemia</font></td>
  16. <td class="2" align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  17. <td class="2" align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  18. </tr>
  19. <tr>
  20. <td><font face="Tahoma" style="font-size: 9pt">Chemia</font></td>
  21. <td align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  22. <td align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  23. </tr>
  24. <tr>
  25. <td class="2"><font face="Tahoma" style="font-size: 9pt">Chemia</font></td>
  26. <td class="2" align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  27. <td class="2" align="center"><font style="font-size: 9pt">Jan Kowalski</font></td>
  28. </tr>
  29. </div>

Dlaczego w co 2 wierszu nie mam innego koloru tła?
Skoro ustawiłem w tabeli klasy w co drugim wierszu na "2" a w stylach ustawiłem kolor tła dla klasy "2"?

//
Dzięki za szybką i profesjonalną odpowiedź (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

Ten post edytował Darou 2.06.2008, 18:41:16
Go to the top of the page
+Quote Post
Crozin
post
Post #4





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Nazwa klasy nie może zaczynać się cyfrą

btw: do tworzenia nagłówków tabel masz <thead> i <th>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 02:13