llantwit
asked on
add scroll bar to table
I am trying to add a scroll bar to the table but keep hiting errors:-
<html>
<head>
<title>Month Summary</title>
<!-- change styles if you want -->
<style type="text/css">
A:link {text-decoration: none; color: black;}
A:visited {text-decoration: none; color: black;}
A:active {text-decoration: none; color: black;}
A:hover {text-decoration: underline; color: red;}
p {font-family: georgia, verdana, sans-serif; font-size: 13px; color: #333333; }
h1 {font-family: georgia, verdana, sans-serif; font-size: 16px; color: #660000; }
body {background-color: #fcfcfc;}
</style>
</head>
<body>
<?php
// THERE IS NO NEED TO EDIT BELOW HERE
$mon = date("m",mktime()); // month from clicked month name
$month = intval($mon); // var to use with month name array
if (strlen($mon)==1) { $mon = "0". $mon; }
$yr = date("Y",mktime()); // year from clicked month name
include("cal_parms.php");
include("./lang/dat_nam_en .php"); // load default language file so as not to mess anything upp with new text.
include($dat_names); // retrieved from cal_parms.php as a 'language' file
include("cal_db_conn.php") ;
mysql_connect($db_host, $db_login, $db_pass) or die ("Can't connect!");
mysql_select_db($db_name) or die ("Can't open database!");
$min_dat = $yr. "-". $mon. "-01";
$max_dat = $yr. "-". $mon. "-31"; //sloppy but effective
// retrieve all events for the month
error_reporting(0);
$query = "SELECT * from $db_table WHERE date_format(ev_dat, '%Y-%m')='$yr-$mon' ORDER by ev_dat";
$result = @mysql_db_query($db_name, $query);
echo "<table width='350' height='250' cellpadding='3' cellspacing='3' align='left' style='border: thin dotted #999999;' bgcolor='#bfffd4'><tr><td> ";
<td><div id="tablescroll">
while ($myrow = mysql_fetch_array($result) ) // loop through all results
{
$found = $myrow['ev_dat'];
$pieces = explode("-", $found);
$monum = intval($pieces[1]);
$danum = intval($pieces[2]);
echo "<h1>". $danum. " ". $mo[$month]. ", ". $yr. "</h1>";
echo "<p><strong>". $EventText. ": </strong>". $myrow['ev_title']. "<br/>";
echo "<strong>". $LocationText. ": </strong>". $myrow['ev_locn']. "<br/>";
echo "<strong>".$DetailsText. ": </strong>". nl2br($myrow['ev_desc']). "</p>";
$i++;
}
if ($i==0) { echo "<h1>".$noEventsText." ". $mo[$month]. "</h1>"; }
if ($sho == "1") {
echo "";
}
else {
echo "";
}
?>
</td></tr></td></div></tab le>
</html>
</body>
<html>
<head>
<title>Month Summary</title>
<!-- change styles if you want -->
<style type="text/css">
A:link {text-decoration: none; color: black;}
A:visited {text-decoration: none; color: black;}
A:active {text-decoration: none; color: black;}
A:hover {text-decoration: underline; color: red;}
p {font-family: georgia, verdana, sans-serif; font-size: 13px; color: #333333; }
h1 {font-family: georgia, verdana, sans-serif; font-size: 16px; color: #660000; }
body {background-color: #fcfcfc;}
</style>
</head>
<body>
<?php
// THERE IS NO NEED TO EDIT BELOW HERE
$mon = date("m",mktime()); // month from clicked month name
$month = intval($mon); // var to use with month name array
if (strlen($mon)==1) { $mon = "0". $mon; }
$yr = date("Y",mktime()); // year from clicked month name
include("cal_parms.php");
include("./lang/dat_nam_en
include($dat_names); // retrieved from cal_parms.php as a 'language' file
include("cal_db_conn.php")
mysql_connect($db_host, $db_login, $db_pass) or die ("Can't connect!");
mysql_select_db($db_name) or die ("Can't open database!");
$min_dat = $yr. "-". $mon. "-01";
$max_dat = $yr. "-". $mon. "-31"; //sloppy but effective
// retrieve all events for the month
error_reporting(0);
$query = "SELECT * from $db_table WHERE date_format(ev_dat, '%Y-%m')='$yr-$mon' ORDER by ev_dat";
$result = @mysql_db_query($db_name, $query);
echo "<table width='350' height='250' cellpadding='3' cellspacing='3' align='left' style='border: thin dotted #999999;' bgcolor='#bfffd4'><tr><td>
<td><div id="tablescroll">
while ($myrow = mysql_fetch_array($result)
{
$found = $myrow['ev_dat'];
$pieces = explode("-", $found);
$monum = intval($pieces[1]);
$danum = intval($pieces[2]);
echo "<h1>". $danum. " ". $mo[$month]. ", ". $yr. "</h1>";
echo "<p><strong>". $EventText. ": </strong>". $myrow['ev_title']. "<br/>";
echo "<strong>". $LocationText. ": </strong>". $myrow['ev_locn']. "<br/>";
echo "<strong>".$DetailsText. ": </strong>". nl2br($myrow['ev_desc']). "</p>";
$i++;
}
if ($i==0) { echo "<h1>".$noEventsText." ". $mo[$month]. "</h1>"; }
if ($sho == "1") {
echo "";
}
else {
echo "";
}
?>
</td></tr></td></div></tab
</html>
</body>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.