Created
May 10, 2018 18:19
-
-
Save jagveerdev/e3802c7da0a3152ab3993bcc7c529823 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| <script> | |
| var z =["Jaspal","Amanpreet","Gurinder","Jagveer","Pritpal","Preet","rwerwere","yrtyfdvdf"]; | |
| document.write('<table border="5" cellpadding="15" cellspacing="10"><tr style="background-color:grey; color:white"><th>Roll No</th><th>Names</th></tr>'); | |
| for( var a=0; a<z.length; a++){ | |
| var j=a+1; | |
| if(j%2==0){ | |
| document.write('<tr style="color:green; background-color:blue"><td>'+j+'</td><td>'+z[a]+'</td></tr>'); | |
| }else{ | |
| document.write('<tr style="color:red; background-color:yellow"><td>'+j+'</td><td>'+z[a]+'</td></tr>'); | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment