Click to See Complete Forum and Search --> : tabels and div's


pelegk1
12-17-2003, 07:59 AM
i have a table with few row's
between every row i have a row with a div
that when a user presses on a button
into the div i write another table ith the same number of columns!
the problem is that the structure on the screen is that
the table in the div smaller and the width of each td isnt like the main table td's width
the table is something like this :
<table>
<tr>
<td>aaa</td>
<td>bbb</td>
<td>ccc</td><td>ddd</td>
</tr>
<tr>
<td>123</td>
<td>23453245</td>
<td>c1234</td><td>123412</td>
</tr>
<tr>
<td colspan='8'><div id='div1'></div></td></tr>
tr>
<td>12wqerrq3</td>
<td>23rqwerq453245</td>
<td>c12rwqrq34</td><td>rqwrqqrwe</td>
</tr>
</table>
and so on
so what is the problem?
thanks in advance
peleg

TheBearMay
12-17-2003, 09:06 AM
The problem is that the columns in the DIV are not tied to the main table, but are seen as a sub-table. I've got a few ideas on how to solve, but let me try them out first.

PS - If anyone else has a solution go ahead and post, it may take me a bit to get back....

TheBearMay
12-17-2003, 09:51 AM
I'm back, and I have good news and bad news... The good news is that you can do it, the bad news is that you need to define a DIV per TD:


<table border=1>
<tr><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td></tr>
<tr><td><div id="addTable"></div></td>
<td><div id="addTable1"></div></td>
<td><div id="addTable2"></div></td>
<td><div id="addTable3"></div></td></tr>
<tr><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td></tr>
<tr><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td></tr>
</table>
<button onclick="addTable.innerHTML='<td>kkkk</td></td>';
addTable1.innerHTML='<td>kkkk</td></td>';
addTable2.innerHTML='<td>kkkk</td></td>';
addTable3.innerHTML='<td>kkkk</td></td>';">Add Row</button>

pelegk1
12-18-2003, 01:11 AM
beacuse the data i put betwen 2 rows i get fom the server and it includes a table or any other structure that i like
so what to do?
please help

pelegk1
12-18-2003, 01:55 AM
in put this div in every second row beacuse i want to put there a table in the size of rows that i dont know in advance
your idea is great but how can i use it to solve my problem?

pelegk1
12-18-2003, 02:11 AM
in your way i dont need to put div's at all!!!!
i can write to the td itself!
say instead of id="addTable"
i do <td id="addTable">
i will get the same effect no need of the div
so we are in start position again