Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS][PHP]Krzywe dane w tabeli., tabela
Gothicbezimienny
post 26.12.2014, 03:33:16
Post #1





Grupa: Zarejestrowani
Postów: 66
Pomógł: 0
Dołączył: 5.11.2014

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


Witam, chciałem zrobić prosty scroll do same tbody w tabeli, lecz wszędzie gdzie znalazłem na ten temat informacje pisz by zrobić w css z tbody i thead osobny blok : display: block; ale w tedy dane w każdej linijce układają mi sie w innej długości. Mogłby mi ktoś doradzić jak to zrobić ? ew. jakim sposobem wyrównać komórki żeby były tej samej wielkości.

Screeny : http://speedy.sh/3AZGz/tabela.png

Mój plik css.
  1. .off table
  2. {
  3. text-align:justify;
  4. font: verdana;
  5. font-size:12px;
  6. color:black;
  7. line-height:20px;
  8. height: auto;
  9. width:50%;
  10. margin: 0 auto;
  11. padding:0px 30px 0px 0px;
  12. border-collapse:collapse;
  13. border:1px solid #FFCA5E;
  14. }
  15.  
  16.  
  17.  
  18. .off thead th
  19. {
  20. background: url(../images/pasek.jpg) no-repeat right;
  21. height: 40px;
  22. color: #000;
  23. font-size: 1em;
  24. font-weight: bold;
  25. padding: 0px 10px;
  26. margin: 40px 0px 0px ;
  27. text-align: center;
  28. border-right: 1px solid #FCF1D4;
  29. }
  30.  
  31.  
  32.  
  33. .off tbody th, .off td
  34. {
  35. font-size: 0.9em;
  36. line-height: 1.5em;
  37. font-family: Arial, Helvetica, sans-serif;
  38. color: #777777;
  39. padding: 10px 7px;
  40. border-top: 1px solid #FFCA5E;
  41. border-right: 1px solid #DDDDDD;
  42. text-align: center;
  43.  
  44.  
  45.  
  46. }
  47.  
  48. /*
  49. *cienie row
  50. */
  51. .off tbody tr
  52. {
  53. background: url(../images/bg_td1.jpg) repeat-x top;
  54.  
  55.  
  56. }
  57.  
  58. /*
  59. *podswietlenie najehanego
  60. */
  61. .off table tbody tr:hover {
  62. background: #FFE9A0;
  63.  
  64. }
  65.  
  66. /*
  67. *kolor row
  68. */
  69. .off tbody tr
  70. {
  71. background: #FFF8E8 url(../images/bg_td2.jpg) repeat-x ;
  72.  
  73. }
  74.  
  75.  


Ten post edytował Gothicbezimienny 26.12.2014, 03:33:44
Go to the top of the page
+Quote Post
fate
post 26.12.2014, 17:23:07
Post #2





Grupa: Zarejestrowani
Postów: 824
Pomógł: 106
Dołączył: 14.03.2012
Skąd: Warszawa

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


tbody{overflow:scroll;}


--------------------
Go to the top of the page
+Quote Post
Gothicbezimienny
post 26.12.2014, 18:37:23
Post #3





Grupa: Zarejestrowani
Postów: 66
Pomógł: 0
Dołączył: 5.11.2014

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


to nie jest takie proste, gdy dodaje faktycznie pojawia sie scroll, ale nie aktywny nawet gdy zmieniam wielkoscc tablicy z auto, plus do tego komórki z tbody nie pasują do komórek z thead.
Go to the top of the page
+Quote Post
slash^
post 26.12.2014, 22:29:12
Post #4





Grupa: Zarejestrowani
Postów: 278
Pomógł: 36
Dołączył: 9.04.2003
Skąd: Płock

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


Musisz albo w CSS ustawić szerokość kolumn, albo obliczać ją za pomocą js i dodawać do strony.


--------------------
d(^^)b
Go to the top of the page
+Quote Post
trueblue
post 26.12.2014, 22:32:24
Post #5





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Spróbuj: http://stackoverflow.com/questions/673153/...818428#25818428


--------------------
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 00:36