Forums

ASP

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>
&lt;% If rs("myField" = "" then %&gt;
&lt;tr&gt;
&lt;td colspan='2'&gt;One Cell Spanning 2&lt;/td&gt;
&lt;/tr&gt;
&lt;% else %&gt;
&lt;tr&gt;
&lt;td&gt;Cell One&lt;/td&gt;
&lt;td&gt;Cell Two&lt;/td&gt;
&lt;/tr&gt;
&lt;% end if %&gt; </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

Reply to this topic