Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][JavaScript]js dodawanie wierszy do tabeli
neo1986kk
post
Post #1





Grupa: Zarejestrowani
Postów: 561
Pomógł: 3
Dołączył: 2.02.2009

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


  1. <table id="tablerd">
  2. <tr><td>tytul</td><td>plyta></td><td>ilosc</td></tr>
  3. //tutaj powinien dodac
  4. //<tr><td>a</td><td>b</td><td>c</td><tr>
  5. </table>


  1. r1 = document.createElement('tr');
  2. r1.setAttribute("class", "row");
  3. r1.innerHTML = '<td>a</td><td>b</td><td>c</td>';
  4. t1 = document.getElementById('tablerd');
  5. t1.appendChild(r1);


czemu dodaje bez znaczników <td>?

wychodzi co takiego

<table>
<tr><td>tytul</td><td>plyta></td><td>ilosc</td></tr>
<tr>abc</tr>
</table>
Go to the top of the page
+Quote Post

Posty w temacie


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 - 10:06