<th rowspan="2">Course</th>
                <th rowspan="2">My Credits</th>
                <th colspan="3">Stats from Batch</th>
                <th rowspan="2">No. of Students</th>
            </tr>
            <tr>
                <th>Max</th>
                <th>Average</th>
                <th>Min</th>
            </tr>
            <?php 
foreach ($courseStats as $row) {
    $myCred = getMyCredits($row["code"], $login_session);
    echo '<tr>';
    echo '<td>' . $row['code'] . ' : ' . $row['title'] . '</td>';
    echo "<td>" . $myCred["myCreds"] . "</td>";
    echo "<td>" . $row['max'] . "</td>";
    echo "<td>" . round($row['avg'], 2) . "</td>";
    echo "<td>" . $row['min'] . "</td>";
    echo "<td>" . getTotalStudentsForCourse($row["code"], $year, $semester) . "</td>";
    echo "</tr>";
}
?>
            </table>
        </div>
    <!-- Div to print button -->
    <div id="feedback">
        <button onclick=printTheDiv()>To Print</button>

    </div> 
</body>
            <?php 
foreach ($courseList as $course) {
    $batchwiseStats = getBatchwiseStats($course['code']);
    $courseTitle = "a";
    $displayTitle = "";
    $displayCode = "";
    foreach ($batchwiseStats as $row) {
        if ($courseTitle != $row["title"]) {
            $displayTitle = $row["title"];
            $courseTitle = $row["title"];
            $displayCode = $row["code"] . " : ";
        } else {
            $displayTitle = "";
            $displayCode = "";
        }
        $noOfStudents = getTotalStudentsForCourse($row["code"], $row['year'], $row['semester']);
        echo '<tr>';
        echo '<td>' . $displayCode . $displayTitle . '</td>';
        echo "<td>" . $row['intake'] . "</td>";
        echo "<td>" . $row['max'] . "</td>";
        echo "<td>" . round($row['avg'], 2) . "</td>";
        echo "<td>" . $row['min'] . "</td>";
        echo "<td>" . $noOfStudents . "</td>";
        echo "</tr>";
    }
    echo '<td></td>';
}
?>
            </table>
    
    </div>