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
PHPSysinfo CentOS 7 Installer Script January 23, 2024 Intended to to deploy on a barebone fresh CentOS installation with Apache and PHP- !#/bin/sh ################################################# # Server Configuration for Centos 6.8 Final # # Don’t use port 7071 # Updated by Rumi- hasan@servermart.net # ################################################# ## updating packages sudo yum update -y ## installing dependencies sudo yum install unzip… Read More
Create logout link in WordPress January 11, 2011 To create your own proper WordPress logout (or sign out) link, you need PHP. PHP Default usage <a href="<?php echo wp_logout_url(); ?>" title="Logout">Logout</a> Logout and Redirect to Current Page <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Logout</a> Logout and Redirect to Homepage <a href="<?php echo wp_logout_url( get_bloginfo('url') ); ?>"… Read More
Clean RDP Sessions June 18, 2022 Just found it useful with the garbage of RDP session to clean- Paste the below lines on a notepad and rename it- rdp_clean.bat. Execute the batch file through cmd line as admin user. @echo off reg delete “HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default” /va /f reg delete “HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers” /f reg add… Read More