Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Zmiania na div'y i problem z php.
Mernest1
post 17.06.2006, 19:59:23
Post #1





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

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


Witam napotkałem problem z którym nie moge sobie poradzić. Przerzucałem stronke z tabelek na div'y i miałem w takim małym systemie newsowym następujący kod:

  1. <?php do { ?>
  2. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="glowna">
  3. <tr>
  4. <td width="10" rowspan="3" valign="top" background="images/08.jpg"></td>
  5. <td height="20" colspan="5" valign="middle" background="images/09.jpg"><div align="center"><?php echo $row_Recordset1['temat']; ?></div></td>
  6. <td width="10" rowspan="3" valign="top" background="images/10.jpg"></td>
  7. </tr>
  8. <tr>
  9. <td height="10" colspan="5" valign="top" background="images/11.jpg"></td>
  10. </tr>
  11. <tr>
  12. <td height="14" colspan="5" valign="top" background="images/12.jpg"></td>
  13. </tr>
  14. <tr>
  15. <td height="108" valign="top" background="images/13.jpg"></td>
  16. <td width="8" valign="top" background="images/14.jpg"></td>
  17. <td colspan="3" align="left" valign="top" background="images/15.jpg"><div align="left"><?php echo $row_Recordset1['tresc']; ?></div></td>
  18. <td width="10" valign="top" background="images/16.jpg"></td>
  19. <td valign="top" background="images/17.jpg"></td>
  20. </tr>
  21. <tr>
  22. <td rowspan="3" valign="top" background="images/18.jpg"></td>
  23. <td height="17" colspan="5" valign="top" background="images/19.jpg"></td>
  24. <td rowspan="3" valign="top" background="images/20.jpg"></td>
  25. </tr>
  26. <tr>
  27. <td height="21" valign="top" background="images/21.jpg"></td>
  28. <td width="286" valign="middle" background="images/22.jpg"><div align="center"><?php echo $row_Recordset1['data']; ?></div></td>
  29. <td width="17" valign="top" background="images/23.jpg"></td>
  30. <td width="279" valign="middle" background="images/24.jpg"><div align="center"><?php echo $row_Recordset1['bywho']; ?></div></td>
  31. <td valign="top" background="images/25.jpg"></td>
  32. </tr>
  33. <tr>
  34. <td height="32" colspan="5" valign="top" background="images/26.jpg"></td>
  35. </tr>
  36. </table>
  37. <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></td>

Sorki że tak dużo napisałem ale głównie mi chodzi oto żeby on powtarzał divy tak jak podane wyżej tabele czy da się tak wogule zrobić jak tak to czy mógłby ktoś napisać jak byłbym bardzo wdzięczny.
Go to the top of the page
+Quote Post
Balas
post 17.06.2006, 20:50:40
Post #2





Grupa: Zarejestrowani
Postów: 347
Pomógł: 0
Dołączył: 27.08.2005
Skąd: Inowrocław

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


pokaz jak to wyglada na stronie (z grafika itp) to bedzie latwiej (bo narazie jest strasznie nie czytelne) :] (aby oszczedzic kod bedzie trzeba zapewne jeszcze raz pociac grafike)

Ten post edytował OnE.Killer 17.06.2006, 20:51:04


--------------------
Go to the top of the page
+Quote Post
mike
post 17.06.2006, 21:00:35
Post #3





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


1. Użyłes złej pętli. W tym przypadku do ... while jest zawodne i lepsza będzie pętla while
2. A co ma do tego php? Dla php to rybka czy wyświetlasz tabele, bloki, czy czysty tekst. Nie ma to najmniejszego znaczenia.

  1. <?php
  2.  
  3. while( $row_Recordset1 = mysql_fetch_assoc( $Recordset1 ) )
  4. {
  5. ?>
  6. <div class="">
  7. <div class="temat"><?php echo $row_Recordset1['temat']; ?></div>
  8. <div class="tresc"><?php echo $row_Recordset1['tresc']; ?></div>
  9. <div class="data"><?php echo $row_Recordset1['data']; ?></div>
  10. <div class="bywho"><?php echo $row_Recordset1['bywho']; ?></div>
  11. </div>
  12. <?php
  13. }
  14. ?>
Go to the top of the page
+Quote Post
Mernest1
post 17.06.2006, 23:48:25
Post #4





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

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


Wielkie dzięki guitar.gif jutro pomęcze to troszke bardziej, bo dziś to już mi głowa pęka od monitora.
Ps. Ładny awatarek (mike_mech) winksmiley.jpg



---
Cieszę się, że sie podoba smile.gif
~mike_mech
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: 21.06.2025 - 23:14