Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [html] jak poprawnie umiescic formularz w tabeli ?
Forum PHP.pl > Forum > Przedszkole
Sir_Yaro
Witam.
Jestem bardzo poczatkujacy wiec bardzo prosze o pomoc bo nie potrafie tego rozwiazac sam.
php generuje mi kod jak ponizej. Jak sie doczytalem jest zly gdyz nie mozna zagniezdzac formularzy w tabelach. Fakt ze sie to wyswietla inaczej w kazdej przegladarce zdecydowanie to potwierdza. sadsmiley02.gif
Niestety nie potrafie tego poprawic a kilka opisow traktujacych w tym temacie nie rozumiem zbyt dobrze.
Czy potrafilby mi ktos poprawic ten kod tak aby byl poprawny?

Jesli dało by sie takze umiescic te przyciski obok siebie a nie pod soba bylbym dozgonnie wdzieczny....

  1. <table style="text-align: left; width: 100%;" border="1"
  2. cellpadding="0" cellspacing="0">
  3. <tr>
  4. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 30px;">lp</td>
  5. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 125px;">Montażysta</td>
  6. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 125px;">MAC</td>
  7. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 287px;">Adres</td>
  8. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 287px;">Uwagi</td>
  9. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 140px;">Data zlecenia</td>
  10. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 140px;">Data wykonania</td>
  11. <td style="text-align: center; background-color: rgb(204, 204, 255); width: 75px;"></td>
  12. </tr>
  13. <tr><td style="text-align: center; background-color: rgb(204, 204, 255);">4</td>
  14. <td style="text-align: center; background-color: rgb(233, 233, 255); ">Lukasz</td>
  15. <td style="text-align: center; background-color: rgb(233, 233, 255); "><font face="Andale Mono">0014F8FFB5AA</font></td>
  16. <td style="text-align: center; background-color: rgb(233, 233, 255); "></td>
  17. <td style="text-align: center; background-color: rgb(233, 233, 255); "></td>
  18. <td style="text-align: center; background-color: rgb(233, 233, 255); ">2007.11.19</td>
  19. <td style="text-align: center; background-color: rgb(233, 233, 255); "><form name="input" action="qadd.php" method="post"><input type="hidden" name="id" value="24"><input type="hidden" name="dataw" value="2007.11.20"><input type="submit" value="Dziś"></form><form name="input" action="qadd.php" method="post"><input type="hidden" name="id" value="24"><input type="hidden" name="dataw" value="2007-11-19"><input type="submit" value="Wczoraj"></form></td>
  20. <td style="text-align: center; background-color: rgb(233, 233, 255); "><a href="delete.php?id=24"><img style="width: 16px; height: 16px;" alt="delete" src="delete.gif"></a> - <a href="edit.php?id=24"><img style="width: 16px; height: 16px;" alt="edit" src="edit.gif"></a></td>
  21. </tr>
  22. </tbody>
in5ane
Nie doczytałem do końca, bo mi sie nie chce, ale masz wskazówkę:
  1. <tr>
  2. <td>Login:</td>
  3. <td><input type="text"></td>
  4. </tr>
  5. <tr>
  6. <td>Hasło:</td>
  7. <td><input type="password"></td>
  8. </tr>
Cysiaczek
Popraw proszę tytuł topiku na zgodny z zasadami forum Przedszkole
Sir_Yaro
Cytat(in5ane @ 20.11.2007, 13:09:20 ) *
Nie doczytałem do końca, bo mi sie nie chce, ale masz wskazówkę:
  1. <tr>
  2. <td>Login:</td>
  3. <td><input type="text"></td>
  4. </tr>
  5. <tr>
  6. <td>Hasło:</td>
  7. <td><input type="password"></td>
  8. </tr>

no to wydaje mi sie ze tak wlasnie mam.
i to jest wg tego co podaje walidator i wiele postow nawet na tym forum zle...
deirathe
No to zależy czy walidujesz z html czy z xhtml jezeli xhtml to wszystkie tagi musza byc zamkniete, np zamiast
  1. <input type="text" name="nazwa">
powinno byc:
  1. <input type="text" name="nazwa" />

niektore tagi powinny posiadac pewne atrybuty itd... zreszta na w3c walidator powinien ci powiedziec w ktorej lini co jest nie tak i co radzi smile.gif
co do tabeli to powinna zawiraqc conajmniej tag <tbody> zaraz po tagu <table> i powinny byc prawidlowo pozamykane
Sir_Yaro
Dostaje tylko 2 bledy (ponizej). Ktore mi mowia tylko tyle co juz napisalem. ze jest zle i ze tak nie mozna.... sad.gif
Wszystko co napisalicie wydaje mi sie ze mam juz w kodzie od poczatku...

Cytat
Line 99, Column 43: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.
<input type="hidden" name="id" value="21">



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

to jest chyba sedno problemu
Cytat
Line 107, Column 7: end tag for "FORM" which is not finished.
</form>



Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
oczywiscie sa zamkniete w poprawnej kolejnosci

Udalo mi sie rozwiazac (a raczej ominac) polowicznie problem.

  1. <form>
  2. <table>
  3. <tr>
  4. <td>
  5. (RESZTA FORMULARZA)
  6. <td>
  7. </tr>
  8. </table>
  9. </form>

teraz sie waliduje poprawnie.

Problem jest jednak z drugim formularzem. Jak do tej samej komorki wrzucic 2go formularz questionmark.gifquestionmark.gif Przeciz nie moge wyrzucic 2go znacznika form przed table bo sie wszystko w komorce wymiesza.....
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.