Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2004, 01:01 AM
Authorized User
 
Join Date: May 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to saravananedu
Default ROWSPAN PROBLEM

hi..all,
  i found a problem while i want to display a table with rowspan property. if i use rowspan, then the table's alignment gets collapsed. herewith i'm attaching a sample code.Please copy and paste the following code and test it in your browser, and help me out to recover from this problem.

in this, i want to display the first column as a merged one if the consequence data are same. so that i put rowspan=3 (for ex.) in the first td (that is commented in the following code) but i couldn't get the output what i expect. please replace the first <td> with commented <td> and see the output.
==========

<body font="Ms Sans Serif" Size=1>
<table border="1">

<tr><td>val1</td><td>val2</td><td>val3</td><td>sum</td></tr>
<%
for j=1 to 2
sum=0
for i=1 to 3
a=j
b=a+i
c=b+i
sum=sum+a+b+c

%>

<tr><td><%=a%></td><td><%=b%></td><td><%=c%></td><% if i=3 then %><td valign="center" align="center"><%=sum%></td><%else%><td valign="center" align="center">&nbsp;</td><%end if%></tr>
<%
next
next
%>
</table>
</body>

=========

Please help me to solve this problem as quickly as possible.

Thanks in Advance.


Yours,
Saran
__________________
Best Regards,
Saran.
 
Old July 27th, 2004, 03:09 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Saran,

Can't really understand what you're after - the browser is doing what you are telling it to.

Can you explain what you mean by "i want to display the first column as a merged one if the consequence data are same".

Cheers,

Chris


 
Old July 27th, 2004, 03:53 AM
Authorized User
 
Join Date: May 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to saravananedu
Default

At Last i found the solution with the help of my friend.

 i'm using for loop in the example. so i should check the condition "if i=1 then" "end if". when the i takes the value 2 or 3, we should just leave without generate first <td> column.

here is the code:
=======
<body font="Ms Sans Serif" Size=1>
<table border="1">

<tr><td>val1</td><td>val2</td><td>val3</td><td>sum</td></tr>
<%
for j=1 to 2
sum=0
for i=1 to 3
a=j
b=a+i
c=b+i
sum=sum+a+b+c

%>

<tr>
<% if i=1 then%>
<td rowspan=3>
<%=a%></td>
<% end if %><td> <%=b%></td><td><%=c%></td><% if i=3 then %><td valign="center" align="center"><b><%=sum%></b></td><%else%><td valign="center" align="center">&nbsp;</td><%end if%></tr>
<%
next
next
%>
</table>
</body>

============

but now i have another small doubt.
  see the output of the above coding, and in that, can we set the sum value to the middle of its corresponding block. ie. now it is displayed in 3rd row of every block. i want it to display on 2nd row.
is it possible without any looping process(ie..we should not calculate the sum in advance and display). is there any rowspan related property to go back to 2nd row from 3rd row.



Yours,
Saran
 
Old July 27th, 2004, 03:58 AM
Authorized User
 
Join Date: May 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to saravananedu
Default

Hi Chris,

Thanks for your reply.
actually i found a solution for this. please see the reply to ROWSPAN PROBLEM in our forum and in this now i got another doubt. please see it and give me suggestions.
thanx

Quote:
quote:Originally posted by ChrisScott
 Hi Saran,

Can't really understand what you're after - the browser is doing what you are telling it to.

Can you explain what you mean by "i want to display the first column as a merged one if the consequence data are same".

Cheers,

Chris


Yours,
Saran





Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling the gaps of rowspan/colspan sources maikm XSLT 3 August 27th, 2008 03:36 AM
Using Rowspan in datagrid bala24 General .NET 2 February 15th, 2008 03:21 AM
Gridview Rowspan and ColumnSpan ramuis78 ASP.NET 2.0 Professional 3 June 25th, 2007 09:29 PM
RowSpan not working like I thought MLaGrange ASP.NET 2.0 Basics 0 February 20th, 2006 10:13 AM
RowSpan tgopal Javascript 6 September 28th, 2004 03:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.