incorporate this style method
<div class="student-info-container" style="font-size: 14px; color: black; font-weight: bold;">

    <div class="info-row" style="display: flex; flex-direction: column; margin-bottom: 10px;">
        <div class="info-label"><b>NAME OF STUDENT:  <u><?php echo $this->customlib->getFullName($student['lastname'], $student['middlename'], $student['firstname'], $sch_setting->middlename, $sch_setting->lastname); ?></u></b></div>
    </div>

    <div class="info-row" style="display: flex; flex-direction: column; margin-bottom: 10px;">
        <div class="info-label"><b>CLASS: <?php echo $student['class'] . ' ' . $student['section']; ?></b></div>
        
    </div>

    <div class="info-row" style="display: flex; flex-direction: column; margin-bottom: 10px;">
        <div class="info-label"><b>SESSION: <?php echo $this->setting_model->getCurrentSessionName(); ?></b></div>
    </div>

    <div class="info-row" style="display: flex; flex-direction: column; margin-bottom: 10px;">
        <div class="info-label"><b>SEX: <?php echo $student['gender']; ?></b></div>
    </div>

    <div class="info-row" style="display: flex; flex-direction: column; margin-bottom: 10px;">
        <div class="info-label"><b>TERM: 3RD TERM</b></div>
    </div>
    
</div>
into this one -<table align="center" class="table table-responsive" style="font-size: 14px;color: black;font-weight: bold;">
                 <tr>
                    <td rowspan="4"><img class="center-cropped img-square" src="<?php
                                                    if (!empty($student["image"])) {
                                                        echo base_url() . $student["image"];
                                                    } else {
                                                        
                                                        if($student['gender']== 'Female'){
                                                             echo base_url() . "uploads/student_images/default_female.jpg";
                                                        }else{
                                                             echo base_url() . "uploads/student_images/default_male.jpg";
                                                        }
                                                       
                                                    }
                                                    ?>" alt="User profile picture"></td>
                    <td></td>
                    <td style="border: 1px transparent; text-align:left;"></td>
                    <td style="border: 1px transparent; text-align:left;"></td>        
                </tr>
                <tr>
                    <td style="border: 1px transparent; text-align:left;white-space: nowrap;"><b>NAME OF PUPIL: &nbsp;<u style="font-size: 14px;"><?php echo $this->customlib->getFullName($student['lastname'],$student['middlename'],$student['firstname'],$sch_setting->middlename,$sch_setting->lastname);  ?></u></b>&nbsp;&nbsp;</td>
                    <td style="border: 1px transparent; text-align:left;"><b>DOB:&nbsp;<?php if (!empty($student['dob']) && $student['dob'] != '0000-00-00') {
    echo date($this->customlib->getSchoolDateFormat(), $this->customlib->dateyyyymmddTodateformat($student['dob']));
}
?></b></td>
                    <td style="border: 1px transparent; text-align:left;"><b>SEX: <?php echo $student['gender']; ?></b></td>        
                </tr>
                <tr>
                    <td style="border: 1px transparent; text-align:left;"><b>PUPIL-ID:&ensp;<?php echo $student['admission_no']; ?></td>
                    <td style="border: 1px transparent;text-align:left;white-space: nowrap;"><b>CLASS: <?php echo $student['class'] . ' ' . $student['section']; ?> </b></td>
                    <td style="border: 1px transparent;text-align:left;"><b>TERM:&ensp;<?php 
               if ($exam_value->is_first == 1 || $exam_value->is_firstmid == 1) {
                   echo "1ST TERM";
               } 
              
               if ($exam_value->is_sec == 1 || $exam_value->is_secmid == 1) {
                   echo "2ND TERM";
               }

               if ($exam_value->is_third == 1 || $exam_value->is_thirdmid == 1) {
                   echo "3RD TERM";
               }
              
            ?></b>
                    </td>
                </tr>
                <tr>
                    <td style="border: 1px transparent;text-align:left;"><b>NO. OF TIMES SCHOOL OPEN:&nbsp;<?php echo $exam_value->sch_open;?></b>&nbsp;&nbsp;</td>
                    <td style="border: 1px transparent;text-align:left;white-space: nowrap;"><b>NO OF ATTENDANCE:&nbsp;<?php echo $student['no_atten'];?></b>&nbsp;</td>
                    <td style="border: 1px transparent;text-align:left;"><b> SESSION:&nbsp;<b style="white-space: nowrap;"><?php echo $this->setting_model->getCurrentSessionName(); ?></b></td>
                </tr>
            </table>

I don't want the table format, so that it will be mobile friendly