<DIV> tag applied across rows in a table

D

Dave

When I put my <div> tag around multiple table rows like this...

<div id="div4" style="display:none;">
<%
Do while not rs2.eof
%>
<tr>
<td>
<%
Response.Write ("<p>" & rs2.Fields("example") & "</p>")
%>
</td>
</tr>
</div>
<%
rs2.movenext
Loop
%>


...it does not apply. IOW all rows will display even though the
style="display:none;"

But if I set my <div> tag up around each cell like this...

<%
Do while not rs2.eof
%>
<tr>
<td>
<div id="div4" style="display:none;">
<%
Response.Write ("<p>" & rs2.Fields("example") & "</p>")
%>
</div>
</td>
</tr>
<%
rs2.movenext
Loop
%>

...the style is applied but I can only reference the first row in the table.
This is beacuse I now have multiple tags with the same id ("div4").

Is there any way to apply <div> tag across table rows so I can operate on
several rows at once?
 
M

Murray

Do your div around a new table. In other words, terminate the preceding
table, add the div around a new table, and stack a third one underneath if
you need it -

<table>
</table>
<div id="div4">
<table>
</table>
</div>
<table>
</table>
 
J

Jens Peter Karlsen [FP-MVP]

That is not valid HTML. Do as Murray suggest.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top