$scope.routines = [
{ CLASSTIME_ID: 1, COURSE_CODE: "CSTE-1001", SEMESTER_ID: "1st", WEEKDAY: "Sunday" },
{ CLASSTIME_ID: 2, COURSE_CODE: "CSTE-1002", SEMESTER_ID: "1st", WEEKDAY: "Sunday" },
{ CLASSTIME_ID: 1, COURSE_CODE: "CSTE-1003", SEMESTER_ID: "2nd", WEEKDAY: "Monday" }
];
$scope.classtimes = [
{ CLASSTIME_ID: 1 ,CLASSTIME: "9.00-9.50" },
{ CLASSTIME_ID: 2, CLASSTIME: "10.00-10.50" },
{ CLASSTIME_ID: 3, CLASSTIME: "11.00-11.50" },
{ CLASSTIME_ID: 4, CLASSTIME: "12.00-12.50" },
{ CLASSTIME_ID: 5, CLASSTIME: "14.00-14.50" },
{ CLASSTIME_ID: 6, CLASSTIME: "15.00-15.50" },
{ CLASSTIME_ID: 7, CLASSTIME: "16.00-16.50" }
];
$scope.weekdays = [
{ WEEKDAY: "Sunday" },
{ WEEKDAY: "Monday" },
{ WEEKDAY: "Tuesday" },
{ WEEKDAY: "Wednesday" },
{ WEEKDAY: "Friday" }
];
<table class="table-bordered table-striped table-responsive">
<thead>
<tr>
<th style="width: 150px; height: 30px;
background-color: rgb(17, 124, 183);color: white; text-align: center">Day</th>
<th style="width: 150px; height: 30px;
background-color: rgb(17, 124, 183);color: white; text-align: center"
ng-repeat="c in classtimes | unique:'CLASSTIME_ID'">{{c.CLASSTIME}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in routines">
<td style="width: 150px; height: 30px;
background-color: rgb(57, 111, 141); color: white; text-align: center">
{{row.WEEKDAY}}
</td>
<td ng-repeat="routine in routines| unique:'CLASSTIME_ID'"
style="width: 150px; height: 30px;
background-color: rgb(0, 127, 198); color: white; text-align: center">
<p ng-if="routine.CLASSTIME_ID === row.CLASSTIME_ID">{{row.COURSE_CODE}}</p>
</td>
</tr>
</tbody>
</table>