R
redpanda
have some questions about JavaServer Pages to ask
1. I made several input fields for user to input the height, width and
other stuff to create a table. how can I make the font in color red in
first row and first column automaticly and font in other rows and
columns remain the same color?
2. I want to add a title inside the table that need to colspan the
rest of the table. Becasue I don't know what # the user will input for
columns, so I can't set it before user input. so plz help me on this.
3. Randomly place an input field in one of the cells – a different
cell on each refresh. If the user enters the correct product there and
changes the focus (by clicking outside the field), a Javascript
provided by the jsp page checks the answer and makes appropriate alert
My jsp file looks like this:
<HTML>
<head></head>
<BODY>
<%
String s2 = request.getParameter("Bsize") ;
s2 = s2.trim();
out.print("<table bgcolor=silver border= ");
out.print(s2);
out.print(" ");
String s3 = request.getParameter("Bcolor") ;
s3 = s3.trim();
out.print("bordercolor= ");
out.print(s3);
out.print(">");
String m1 = request.getParameter("mName") ;
m1 = m1.trim();
int M = Integer.parseInt(m1);
String n1 = request.getParameter("nName") ;
n1 = n1.trim();
int N = Integer.parseInt(n1);
String s = request.getParameter("FullName") ;
s = s.trim();
out.println("<font color=red size=6>");
out.println(s);
out.println("'s table is: </font>");
out.println("<tr colspan= ");
out.print(m1);
out.println(">");
out.print("<th> Numbers </th> </tr>");
for (int i =1; i<= M; i++ )
{
out.println("<tr width= 10 >");
for (int j =1; j<= N; j++ )
{
out.println("<th >");
out.println(j * i);
out.println("</th>");
}
out.println("</tr>");
}
%>
</table>
1. I made several input fields for user to input the height, width and
other stuff to create a table. how can I make the font in color red in
first row and first column automaticly and font in other rows and
columns remain the same color?
2. I want to add a title inside the table that need to colspan the
rest of the table. Becasue I don't know what # the user will input for
columns, so I can't set it before user input. so plz help me on this.
3. Randomly place an input field in one of the cells – a different
cell on each refresh. If the user enters the correct product there and
changes the focus (by clicking outside the field), a Javascript
provided by the jsp page checks the answer and makes appropriate alert
My jsp file looks like this:
<HTML>
<head></head>
<BODY>
<%
String s2 = request.getParameter("Bsize") ;
s2 = s2.trim();
out.print("<table bgcolor=silver border= ");
out.print(s2);
out.print(" ");
String s3 = request.getParameter("Bcolor") ;
s3 = s3.trim();
out.print("bordercolor= ");
out.print(s3);
out.print(">");
String m1 = request.getParameter("mName") ;
m1 = m1.trim();
int M = Integer.parseInt(m1);
String n1 = request.getParameter("nName") ;
n1 = n1.trim();
int N = Integer.parseInt(n1);
String s = request.getParameter("FullName") ;
s = s.trim();
out.println("<font color=red size=6>");
out.println(s);
out.println("'s table is: </font>");
out.println("<tr colspan= ");
out.print(m1);
out.println(">");
out.print("<th> Numbers </th> </tr>");
for (int i =1; i<= M; i++ )
{
out.println("<tr width= 10 >");
for (int j =1; j<= N; j++ )
{
out.println("<th >");
out.println(j * i);
out.println("</th>");
}
out.println("</tr>");
}
%>
</table>