Ok, this is what I want to accomplish. I am creating a popup window that will display thumbnail of pictures. I am dynamically displaying these pictures from an array. Now, I want to be able to display for example if have 26pictures and want to display 4pictures in each rows in a table and then be able to detect that I will have 6 rows with two pictures remaining. I then want to center these last pictures. How do I achieve this? I know I will have to use modular algorithm. for example:
to get the remaining pictures.
I also want to use for loop. I starting something below but I don't know if I was on the right track. But I don't know how to complete this. Help, please help!!!!!!!!!!!!!!!!!
Example of what i'm trying to accomplish:
pic1 pic2 pic3 pic4
pic5 pic6 pic7 pic8
pic9 pic10 pic11 pic12
pic13 pic14 pic15 pic16
pic17 pic18 pic19 pic20
pic21 pic22 pic23 pic24
pic25 pic26
Your prompt response will greatly be appreciated.
Code:
var remainVal=NumOfPic.length%4.
I also want to use for loop. I starting something below but I don't know if I was on the right track. But I don't know how to complete this. Help, please help!!!!!!!!!!!!!!!!!
Example of what i'm trying to accomplish:
pic1 pic2 pic3 pic4
pic5 pic6 pic7 pic8
pic9 pic10 pic11 pic12
pic13 pic14 pic15 pic16
pic17 pic18 pic19 pic20
pic21 pic22 pic23 pic24
pic25 pic26
Code:
var max = 2; var m = 0; // local variables
for (j=0; j<1; j++) // number of rows
{ //begin j loop
for (k=0; k< max; k++) // across row
{ //begin k loop across row
if (k== max)
{
} // end for n loop
} // end if of k
m++;
if (m % max == 0) {} // end of row
} //end k loop // across row
} //end j loop // number of rows
Your prompt response will greatly be appreciated.