Creating dynamic, tabel-like DIV structre
Hi everyone,
I'm just starting JS and jQuery, so my be there is a much better way than mine. I would love to hear about it! :-)
I need a tabel like structre, "rows" of DIVs with to DIV "cells inside, like this:
- <div id="rowX" class="row" style="xxxxxx"> <div id="A" class="valueA" > <img id="bildA" src="1.png" /> <div id="textA" class="cellText" ></div> </div> <div id="B" class="valB" > <img id="bildB" src="1.png" /> <div id="TextB" class="cellText" ></div> </div> </div>
I would like to creat this dynamicly, so I have this above as a kind of "dummy" and just clone and move it... Works fine, but I would like to access now "A" and "B" for each row, how can I do this? My approach seems not to work...
- $('.row').clone().appendTo('.tabelle'); $('.row:last').css('top', (20*i+20)); $('.row:last .valA:last').id = "cellA_"+i; $('#cellA_' + i).attr('src', 'images/barRed.png');
I would be very happy about if some one could help me out... :)
Thanks, Marco