I recently tried to use a script of Spoono's for the alternating table row colors... unfortunately, i could not get it to work, but this is the closest i've gotten. The result is a page that takes forever (not exaggerating) to load, and once you press the stop button, it displays the table headers, but never the php and the actual page itself is very very long (as in the scrollbar gets small)
here's the code, hopefully it's somethign stupid and i dont have to change much
<html>
<head>
<LINK REL="StyleSheet" HREF="style.css" TYPE="text/css">
<script language="JavaScript">
<!--
function openwindow(url)
{
newwindow=window.open(url, 'name', 'toolbar=mp,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,copyhistory=yes,width=400,height=350');
if (window.focus) {newwindow.focus()}
}
//-->
</script>
</head>
<body bgcolor="#515151" style="margin:0;scrollbar-face-color: #515151; scrollbar-shadow-color: #666666; scrollbar-highlight-color: #515151; scrollbar-3dlight-color: #666666; scrollbar-darkshadow-color: #515151; scrollbar-track-color: #515151; scrollbar-arrow-color: #888888;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td width=50><span class="table_header">Ladder</td><td width=80><p class="table_header">Date</td><td width=80><p class="table_header">Clan</td><td width=50><p class="table_header">LORD</td><td width=50><p class="table_header">Them</td><td width=60><p class="table_header">Outcome</td><td><p class="table_header">Screenshots</td></tr>
<?
include("config.php");
include("functions.php");
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$query = "SELECT battle_id, battle_ladder, battle_date, battle_clan, battle_lordscore, battle_themscore, battle_outcome, battle_map1_url, battle_map1, battle_map2_url, battle_map2, battle_map3_url, battle_map3, timestamp FROM battles ORDER BY timestamp DESC";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
if ($row = mysql_fetch_array($result)) {
//run the for loop
for ($i = 0; i < count($row); $i++) {
// Set Table Row Color
if ($i % 2) {
echo "<tr bgcolor=4a4a4a>";
} else {
echo "<tr bgcolor=4d4d4d>";
}
// Now display our table cell info
}
?>
<td><p><? echo $row["battle_ladder"]; ?></td><td><? echo $row["battle_date"]; ?></td><td><? echo $row["battle_clan"]; ?></td><td><? echo $row["battle_lordscore"]; ?></td><td><? echo $row["battle_themscore"]; ?></td><td><? echo $row["battle_outcome"] ?></td><td><a href="<? echo $row["battle_map1_url"]; ?>"<? $row["battle_map1"]; ?></a> <a href="<? echo $row["battle_map2_url"]; ?>"<? $row["battle_map2"]; ?></a> <a href="<? echo $row["battle_map3_url"]; ?>"<? $row["battle_map3"]; ?></a></td>
<? }
?>
mysql_close($connection);
</tr>
</table>
</body>
</html>
any help would be appreciated -- thanks