Table alternate row background color using javascript Rumi, July 4, 2011January 12, 2016 The code itself speaks....!!! <html> <head> <title>Alternative table row color using javascript.</title> <script language="javascript"> function setcolor() { var tbl = document.getElementById("tblCountry"); tbl.style.color = "white"; tbl.rows[0].style.backgroundColor = "green"; for (var i = 1; i < tbl.rows.length; i++) { if (i % 2 == 0) tbl.rows[i].style.backgroundColor = "gray"; else tbl.rows[i].style.backgroundColor = "brown"; } } </script> </head> <body onload="setcolor();"> <table align="center" width="300px" id="tblCountry"> <tr> <th> Country </th> </tr> <tr> <td> Australia </td> </tr> <tr> <td> China </td> </tr> <tr> <td> Denmark </td> </tr> <tr> <td> India </td> </tr> <tr> <td> USA </td> </tr> </table> </body> </html> Related Scripts
Zimbra Let’s Encrypt SSL Script December 28, 2022 #!/bin/bash -x # SSL certificate installation in Zimbra # with SSL certificate provided by Let’s Encrypt (letsencrypt.org) # Check if running as root if [ “$(id -u)” != “0” ]; then echo “This script must be run as root” 1>&2 exit 1 fi read -p ‘letsencrypt_email [mail@server]: ‘ letsencrypt_email read… Read More
PHP Session test Script May 6, 2018May 6, 2018 I’ve just found a quality script to test php session- unless you’re in dark after some php.ini session tweaking done. To check if sessions really work you can use this code: <?php // Start Session session_start(); // Show banner echo ‘<b>Session Support Checker</b><hr />’; // Check if the page has… Read More
A good Webmail with least complications and have beautiful interface- MailBee July 7, 2008July 7, 2008 I was just tired on working webmail projects with- Horde Neomail Squirrelmail (I did customize quite a long back!) DWMail Uebimiau MDaemon with IIS integration And so many!!!!! Anyway, my eyes were bored in seeing those interfaces on and on, just looked for some new thingy available now a days…… Read More