<style type=”text/css”> tr.s1{ background-color: #e0e0e0; color: black; } tr.s2{ background-color: #ffffff; color: black; } </style> <table> <tr class=”s1″><td>ciao</td><td>come</td></tr> <tr class=”s2″><td>stai</td><td>io</td></tr> <tr class=”s1″><td>bene</td><td>grazie</td></tr> <tr class=”s2″><td>saluti</td><td>ciao</td></tr> </table>
Archive for the ‘Javascript’ Category
How to alternate row color in tables with CSS
Posted in CSS, HTML, Javascript on June 7, 2007 | Leave a Comment »
How to collapse a DIV – Javascript – HTML
Posted in How To, HTML, Javascript on June 6, 2007 | Leave a Comment »
Suppose you have a block of text you want to be collapsible clicking a link. Here is the code: <script language=”javascript”> function switchDiv(id_div) { if(document.getElementById(id_div).style.display == ‘none’) { document.getElementById(id_div).style.display = ‘block’; } else { document.getElementById(id_div).style.display = ‘none’; } } </script>
Page Redirect Techniques – HTML and Javascript
Posted in HTML, Javascript on February 12, 2007 | Leave a Comment »
There are 2 methods to redirect html pages. The first one is pure HTML. The second one is done with Javascript. HTML Method insert this line inside the <head> … </head> block: <meta http-equiv=”refresh” content=”num_sec; URL=new_web_address”> where num_sec is the number of seconds to wait before redirection new_web_address is the new relative or absolute URL [...]