Css is not being apply

in my php code there a line of code "display result " that displays the result in the form of table but when i try to do the css it does not work i am confused about this here below is the part of code that is used to display the result kindly help me as soon as possible :

function print_as_table($exam_schedule) {
    $slots = array(
        '9:00 AM - 10:30 AM',
        '11:00 AM - 12:30 PM',
        '1:00 PM - 2:30 PM',
        '3:00 PM - 4:30 PM',
        '5:00 PM - 6:30 PM'
    );

    $days = array(
        'Monday', 
        'Tuesday', 
        'Wednesday', 
        'Thursday', 
        'Friday', 
        'Saturday', 
        'Sunday'
    );

    echo "<table border='1' cellpadding='5' cellspacing='0'>";
    echo "<tr><th>Time Slot</th>";
    foreach ($days as $day) {
        echo "<th>$day</th>";
    }
    echo "</tr>";

    for ($slot = 0; $slot < count($slots); $slot++) {
        echo "<tr>";
        echo "<td>" . $slots[$slot] . "</td>";  

        for ($day = 0; $day < 7; $day++) {
            if (isset($exam_schedule[$day][$slot]) && !empty($exam_schedule[$day][$slot])) {
                echo "<td>" . $exam_schedule[$day][$slot][0] . "</td>"; 
            } else {
                echo "<td></td>"; 
            }
        }
        echo "</tr>";
    }

    echo "</table>";
}

What css? You need to post the code that doesn’t work and show or describe what is wrong with the result you get from that code and if it is not apparent, show or describe what the correct result should be.

Note: the border, cellpadding, and cellspacing being used in the markup is obsolete. You need to validate the resulting web pages at validator.w3.org

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service