<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TestTabelle</title>
<script type="text/javascript">
function faerbeTabelle() {
var aktMonat=(new Date()).getMonth()+1;
var dieTabelle = document.getElementById("Tabelle");
if (dieTabelle && dieTabelle.nodeName.toLowerCase()=="table") {
var zeile = dieTabelle.rows;
for (var j = 0; j<zeile.length; j++) {
var zelle = zeile[j].cells;
var text = zelle[0].firstChild.data;
var bereich = text.split("-");
for (var a = 0; a<bereich.length; a++) {
var daten = bereich[a].split(".");
if (parseInt(daten[1],10) == aktMonat) zeile[j].className = "aktuell";
}
}
}
}
window.onload = faerbeTabelle;
</script>
<style type="text/css">
body {
color:#000;
background-color:#fff;
}
td.ablinks {
padding-left:10px;
font-size:8pt;
font-weight:bold;
}
tr.bg {
background-color:#FFF;
}
tr.aktuell {
background-color:red;
}
</style>
</head>
<body>
<table id="Tabelle" align="center" width="590" border="0" cellpadding="0" cellspacing="0" style="border-width:1px 1px; border-style:solid; border-color:#F8E0B0;" summary="Infos">
<tr class="bg">
<td height="45" width="130" align="left" class="ablinks">19.01.</td>
<td align="left" style="font-size:8pt;">Neujahrskonzert, 17 Uhr <font color="#FF0000"></font></td>
</tr>
<tr class="bg">
<td height="20" align="left" class="ablinks">09.02.</td>
<td align="left" style="font-size:8pt;">Feuerwehrfasching, 19 Uhr</td>
</tr>
<tr class="bg">
<td height="24" align="left" class="ablinks">29.0. - 03.02.</td>
<td align="left" style="font-size:8pt;">Polit-Comedy-Kabarett, 19 Uhr
</td>
</tr>
<tr class="bg">
<td height="32" align="left" class="ablinks">21.03. - 23.03.</td>
<td align="left" style="font-size:8pt;">Osterausstellung, 14 - 18 Uhr</td>
</tr>
</table>
</body>
</html>function faerbeninit() {
if (typeof(window.onload)=="function") var owol=window.onload;
window.onload=function() {
if (owol) owol();
faerbeTabelle();
}
}
faerbeninit();
document.createTextNode, html ausgeben
slaps313 04.03.2007 - 128 Hits - 4 Antworten
JScript-Code gesucht!
Jürgen52 04.04.2007 - 88 Hits - 3 Antworten
Eingabefelder Positionieren
Deathfun 09.04.2007 - 122 Hits - 9 Antworten
HTML-Seite als Fenster darstellen?
Jürgen52 19.04.2007 - 99 Hits - 1 Antwort
Was macht regsvr32 jscript.dll?
TByte 28.05.2008 - 231 Hits - 4 Antworten