| ' . $rowStop['stop_name'] . ' | ';
                        foreach ($trips as $trip) {
                            $found=false;
                            foreach ($trip['stops'] as $stop) {
                                if ($stop['stop_name'] == $rowStop['stop_name']) {
                                    // check if bus runs on friday only by checking another day (in this case thursday) and apply custom color to cells
                                    if (($day == 'mon_fri') && ($trip['days_of_operation']['mon'] == false)) {
                                        echo '' . $stop['departure_time'] . ' | ';
                                    } else {
                                        echo '' . $stop['departure_time'] . ' | ';
                                    }
                                    $found=true;
                                }
                            }
                            // print something to show bus doesn't use this stop on this trip e.g. route variation
                            if ($found != true) {
                                echo '---- | ';
                            }
                        }
                        echo '
';
                    }
                    echo '