Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [CSS][Html] background image w wierszu tabeli
Forum PHP.pl > Forum > Po stronie przeglądarki > CSS
Xart Irok
Kod na którym pracuje:
  1. .corn {
  2. border-collapse:inherit;
  3. border-spacing: 0;
  4. min-width: 350px;
  5. }
  6. .corn tr th,
  7. .corn tr td {
  8. border-right: 1px solid #bbb;
  9. border-bottom: 1px solid #bbb;
  10. border-image:none;
  11. padding: 5px;
  12. }
  13. .corn tr th:first-child,
  14. .corn tr td:first-child {
  15. border-left: 1px solid #bbb;
  16. }
  17. .corn tr:first-child th{
  18. border-top: 1px solid #bbb;
  19. }
  20. .corn tr:first-child td{
  21. border-top: 1px solid #bbb;
  22. font-weight:bold;
  23. }
  24.  
  25. /* top-left border-radius */
  26. .corn tr:first-child td:first-child {
  27. border-top-left-radius: 6px;
  28. }
  29.  
  30. /* top-right border-radius */
  31. .corn tr:first-child td:last-child {
  32. border-top-right-radius: 6px;
  33. }
  34.  
  35. .corn tr:first-child th:first-child {
  36. border-top-left-radius: 6px;
  37. }
  38.  
  39. /* top-right border-radius */
  40. .corn tr:first-child th:last-child {
  41. border-top-right-radius: 6px;
  42. }
  43.  
  44. /* bottom-left border-radius */
  45. .corn tr:last-child td:first-child {
  46. border-bottom-left-radius: 6px;
  47. }
  48.  
  49. /* bottom-right border-radius */
  50. .corn tr:last-child td:last-child {
  51. border-bottom-right-radius: 6px;
  52. }
  53. .corn .info {
  54. background: url('images/F1G.png') repeat-x;
  55. }
  56. .corn tr:last-child {
  57. background: url('images/F3G.png') repeat-x;
  58.  
  59. }
  60. .corn tr:first-child td {
  61. position:relative;
  62. height: 50px;
  63. }
  64. .corn tr:first-child td:first-child:before {
  65. background: url('images/F1G.png') repeat-x;
  66. content: " ";
  67. width:100%;
  68. height: 70px;
  69. position:absolute;
  70. top: 0;
  71. left: 0;
  72. z-index: -1;
  73. }
  74. @-moz-document url-prefix() {
  75. table tr.disabled td:first-child:before {
  76. display: none;
  77. }
  78. table tr.disabled {
  79. background: url(disabled.png) repeat-x;
  80. }
  81. }
  82. </head>
  83. <table width="100%" class="corn">
  84. <tr>
  85. <td colspan="2">col 1-2</td>
  86. <td>col 3</td>
  87. <td>col 4</td>
  88. <td>col 5</td>
  89. </tr>
  90. <tr class="info">
  91. <td colspan="5">col 1-5</td>
  92. </tr>
  93. <tr class="show">
  94. <td>col 1</td>
  95. <td>col 2</td>
  96. <td>col 3</td>
  97. <td colspan="2">col 4-5</td>
  98. </tr>
  99. <tr>
  100. <td colspan="5">col 1-5</td>
  101. </tr>
  102. </table>
  103. </body>
  104. </html>

Chce w pierwszym i ostatnim wierszu tabeli wrzucić grafikę tak aby została rozciągnięta (zduplikowana) na cały wierszu, aby była ciągła. Efekt zamierzany chciał bym że by był taki: http://projects.keaglez.com/tablerow/index.html
artuross
Tam gdzie first-child i last-child po prostu wstawiasz background: url(grafika.png) repeat-x;
Xart Irok
Cytat(artuross @ 2.04.2013, 23:45:44 ) *
Tam gdzie first-child i last-child po prostu wstawiasz background: url(grafika.png) repeat-x;

Próbowałem tak, ale nie wyświetla w taki sposób jaki bym chciał. last-child był łatwo rozwiązany bo była tylko jedna cała kolumna, mam najgorszy problem z tr:first-child.
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.