How to hide a specific row in a HTML table

Please help me, with how I can solve this
I have a project that looks like this table


and this is my code,

<table class = "table table-striped table-hover">
        <?php $no = 1; foreach($students as $student): ?>
        <?php endforeach; ?>

What I want is, How I can make the table looks like this

Any references to solve this, I try using CSS to hide any element with the same value, but it doesn’t work

This is not a Cake question, or really even a PHP question, but a general programming question. To not show the name when it’s the same as the previous row, remember the name from the previous row, compare against the current name, and only output it if it doesn’t match.

I agree with @Zuluru.

Image 5

In case you need something like this you should investigate about colspan and rowspan.
In the student name td element you should add a rowspan attribute with the number of rows
that element should cover. Subsequent course name and grade result td’s should be on a new row.

bro you have to make two tables for this flow… one for students and second one for courses then set relationship between Student and Course & fetch with contain() method…

$students = $this->Students->find(‘all’)->contain(‘Course’);
this way is best for manage and relationship regarding the student and course. you can also make it more desirable… I just illustrate the work flow here.

If you cannot understand then ping me i will provide you basic code this flow bro