I have a rendered table from a mysql database on my web page. after applying some css properties to it, i want to b able to print that portion where the table is..
here is the php an html code for the portion I'll like to print on a portrait paper orientation
<div id="content">
<div><span style="font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 13pt; color: #8b0000">STUDENTS' ACADEMIC PROFILE</span></div>
<hr style="color:#900;"/>
<div class="rsltPg">
<p>
<div > <div class="titleAmin">
<input name="unimaidLogo" type="image" class="AdminImg" src="../Images/logoanim.gif" alt="unimaidLogo" align="middle" width="45" height="80" hspace="16" vspace="13" />
<p style="font-size:16px">UNIVERSITY OF MAIDUGURI </p>
<p style="font-size:10px">(Faculty of Engineering)</p>
<p>DEPARTMENT OF CHEMICAL ENGINEERING</p>
</div>
<!--
</div>
<div>
<div>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="GET" name="stuRequest" id="stuRequest" >
<p>
<label for="sessionID" style="font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-weight:bold; font-size: 10pt; color: #8b0000">Select Session:</label>
<select name="sessionID" id="sessionID">
<?php
do {
?>
<option value="<?php echo $row_rsAcadsession['id']?>"><?php echo $row_rsAcadsession['sessionID']?></option>
<?php
} while ($row_rsAcadsession = mysql_fetch_assoc($rsAcadsession));
$rows = mysql_num_rows($rsAcadsession);
if($rows > 0) {
mysql_data_seek($rsAcadsession, 0);
$row_rsAcadsession = mysql_fetch_assoc($rsAcadsession);
}
?>
</select>
/
<select name="semesterID">
<option value="1">1st Semester</option>
<option value="2">2nd Semester</option>
</select>
<?php if(isset($_SESSION['studentID']))
{
?>
<p style="padding-removed40px"><input name="chkResults" type="submit" id="chkResults" value="Load Results"></p>
</p></form>
<?php if(isset($_GET['chkResults'])) { ?> <p><label for="stuName">Student Name: </label>
<?php echo $row_rsStursltname['Name']; ?> , <?php echo $row_rsStursltname['lastName']; ?></p>
<p><label for="stuID">Student ID: </label><?php echo $_SESSION['studentID'] ?>
</p>
<p><label for="stuSession">Session: </label>
<?php echo $row_rsStursltYr['sessionID']; ?> </p>
<?php if ($totalRows_rsVwsessrsltdet !=0) {?>
<table align="center">
<caption><p>B. Eng.(Hons) Chemical Engineering</p>
<?php echo $row_rsVwsessrsltdet['levelID']; ?> Level <?php echo $row_rsStursltsem['semesterName']; ?> ,<?php echo $row_rsStursltYr['sessionID']; ?>session
</caption>
<tr>
<th width="15%" scope="col">Course code</th>
<th width="41%" scope="col">Course title</th>
<th width="20%" scope="col"> Unit</th>
<th width="24%" scope="col">Marks</th>
<th width="24%" scope="col">Grade</th>
<th width="24%" scope="col">product</th>
</tr>
<?php do { ?>
<tr class="alt">
<td><a><?php echo $row_rsVwsessrsltdet['courseID']; ?></a></td>
<td><?php echo $row_rsVwsessrsltdet['courseDescription']; ?></td>
<td><?php echo $row_rsVwsessrsltdet['courseUnit']; ?></td>
<td><?php echo $row_rsVwsessrsltdet['Marks']; ?></td>
<td><?php echo $row_rsVwsessrsltdet['Grade']; ?></td>
<td><?php echo $row_rsVwsessrsltdet['GPP']; ?></td>
</tr>
<?php } while ($row_rsVwsessrsltdet = mysql_fetch_assoc($rsVwsessrsltdet)); ?>
</table>
<br />
<?php
while($row=mysql_fetch_array($rsChkarray,MYSQL_BOTH))
{
#calculate the results for each academic semester
mysql_select_db($database_connChePortal, $connChePortal);
$cal_Cumm= "SELECT SUM(vwr.courseUnit) cummUnit, SUM(vwr.GPP) cummGPP
FROM vw_result vwr
WHERE vwr.Grade NOT IN ('F')
AND vwr.id=".$row[0]."
AND vwr.semesterID=".$row[1].";";
$results=mysql_query($cal_Cumm, $connChePortal) or die(mysql_error());
$row_calCumm=mysql_fetch_assoc($results);
#declare the results into variables
$units= $row_calCumm['cummUnit'];
$gpp=$row_calCumm['cummGPP'];
$semesterGPA=($gpp/$units);
#cummulative results
#$cUnit=0;
$cUnit +=$units;
#$cGpp=0;
$cGpp +=$gpp;
$cGpa= ($cGpp/$cUnit);
#echo "</br>";
#print results
if ($row[1]==$_GET['semesterID']){
echo "<p><label for='cumUnit'>
Cummulative Unit:</label>".$cUnit."</p>";
echo "<p><label for='cumPrdt'>
Cummulative GPP:</label>".$cGpp."</p>";
echo "<p><label for='cumGpa'>
Cummulative GPA:</label>".$cGpa."</p>";
}
#check URL variable for the result request
if(($row[0]==$_GET['sessionID']) &&($row[1]==$_GET['semesterID'])) break;
}
?>
<?php } else echo "No result for ".$row_rsStursltYr['sessionID']." session"; ?>
<?php } ?>
</br>
<?php } else echo "<p>No student to view result profile</p>"; ?>
</div>
</div>
<!--
</div>
</div>
PS: recommended resourses also required for mi to learn javascript well.
Thanks