hi
I got 2 questions. 1st, how can I just make the first row and first column are in red font. I don't know what type should I declare the clr. can anyone show me?
2nd. how about randomly place an input field in one of the cells ?
int rndRow = Interger.ParseInt(Math.round(Math.random() * i));
this line give me an error said that "Method ParseInt(double) not found in class java.lang.Integer." what error did I make?
PHP Code:
for (int i =1; i<= M; i++ )
{
if(i == 1) {clr = "#ff0000";} // make the first row in color red
else {clr = "#000000";}
out.println("<tr>");
for (int j =1; j<= N; j++ )
{
int rndRow = Interger.ParseInt(Math.round(Math.random() * i)); // randomly put input field
int rndCol = Interger.ParseInt(Math.round(Math.random() * j)); //randomly put input field
if(j == 1) {clr = "#ff0000";} // make the first col in color red
thanks yerenkow
I solve those 2 questions. but for second question I just want to only one input feild, but it give me multiple input field. also it's messd up with my table cuz the input take one cell and others will shif to right in that row. how can I solve this?
PHP Code:
for (int i =1; i<= M; i++ )
{
out.println("<tr>");
well, I use the following code to get row and col input from user. so how do I initialize j and i?
also I just want to the input field take 1 cell. let's say the row number from 1 to 10 then the input table take the seventh cell. but the totally cell should be equal to 10 (1 2 3 4 5 6 input field 8 9 10)
PHP Code:
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);
thanks man. sorry for delay your sleeping. I fixe the multiple input field.
another question. I just want to the input field take 1 cell. let's say the row number from 1 to 10 and the input table take the seventh cell. but the totally cell should be equal to 10 (1 2 3 4 5 6 input field 8 9 10)
I know that I need add something under this line of code, so the the table creation will ignore the cell that the input field take. but I don't know how
well, it's work. thanks so much.
last question
I want to input the cell number in the input field that I create. e.g. the #34 cell is taken by input field. I want to type 34 in it. if the number that I put is correct, then a pop up window will show up. I wrote the following in javascript, but it's not work
PHP Code:
z=document.getElementById(2).value
z=parseInt(z)
c=i*j
if (z == (i*j) )
{ alert("The answer is "+i+ " * "+j+" = " + z + ". You are right.)
}
Bookmarks