

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:14pt; }
<p style="font-size:10px;"></p>
</style>

</head>


<?php


include "dbconnect.php";
 
$q =  mysqli_query($con,"SELECT lesson, AVG(grade) FROM pan2014 GROUP BY lesson"); 

echo "<table class='myTable' >
<tr style='border:1px solid black' >
</tr>";
echo "<tr > 
<th>ΜΑΘΗΜΑ</th>
<th>ΜΕΣΟΣ ΟΡΟΣ</th>
<th>ΠΑΓΚΥΠΡΙΕΣ</th>
</tr>";


// Print out result
while($row = mysqli_fetch_array($q)){
echo "<td>" . $row['lesson']. "</td>";	
echo "<td>" . round($row['AVG(grade)'],2). "</td>";
echo "<td>" . " ". "</td>";
echo "</tr>";
 	
}
echo "</table>";
?>