Forums
This topic is locked
dynamically change table
Posted 12 Sep 2003 10:10:24
1
has voted
12 Sep 2003 10:10:24 casey conor posted:
Working on a site where one of the tables has two rows and two columns. Content is loaded into each cell when a user makes a choice elsewhere on the page. Sometimes a choice is made which results in one or more of the cells returning empty (due simply to no information being available for that particular field of the record). This looks a bit unsightly so does anyone know how I can get a cell to span two columns if its neighbouring cell is without content? Replies
Replied 19 Sep 2003 11:21:12
19 Sep 2003 11:21:12 Stuart Harland replied:
This could be done in the design using a condition:
e.g.:
<pre id=code><font face=courier size=2 id=code>
<% If rs("myField" = "" then %>
<tr>
<td colspan='2'>One Cell Spanning 2</td>
</tr>
<% else %>
<tr>
<td>Cell One</td>
<td>Cell Two</td>
</tr>
<% end if %> </font id=code></pre id=code>
This is just an example of how to do it, would be better to do it all as one code block using response.write to do the table output.
********************
Stuart - Ferox
e.g.:
<pre id=code><font face=courier size=2 id=code>
<% If rs("myField" = "" then %>
<tr>
<td colspan='2'>One Cell Spanning 2</td>
</tr>
<% else %>
<tr>
<td>Cell One</td>
<td>Cell Two</td>
</tr>
<% end if %> </font id=code></pre id=code>
This is just an example of how to do it, would be better to do it all as one code block using response.write to do the table output.
********************
Stuart - Ferox