Общая г.....кодная идея : )
<?php
echo '<style>
table,td,tr{border: 1px green solid; padding : 2px;text-align :center;border-collapse: collapse;}</style>';
$data = [ // при запросе из БД отсортируй по дате
['fio'=>'Kolya', 'date'=>'12.12.19', 'cha'=>'12'],
['fio'=>'Petya', 'date'=>'12.12.19', 'cha'=>'12'],
['fio'=>'Vasya', 'date'=>'12.12.19', 'cha'=>'5'],
['fio'=>'Seroja', 'date'=>'13.12.19','cha'=>'2'],
['fio'=>'Igor', 'date'=>'14.12.19', 'cha'=>'6'],
['fio'=>'Sanya', 'date'=>'14.12.19', 'cha'=>'5'],
['fio'=>'Kolya', 'date'=>'15.12.19', 'cha'=>'6'],
['fio'=>'Kolya', 'date'=>'16.12.19', 'cha'=>'2'],
['fio'=>'Vasya', 'date'=>'17.12.19', 'cha'=>'2'],
['fio'=>'Igor', 'date'=>'18.12.19', 'cha'=>'2'],
['fio'=>'Kolya', 'date'=>'18.12.19', 'cha'=>'2'],
];
$allDates = array_unique(array_column($data,'date'));
echo "<table><tr><td>Name</td><td>".implode('</td><td>',$allDates)."</td></tr>";
foreach(array_unique(array_column($data,'fio')) as $name){
echo "<tr><td>$name</td>";
foreach($allDates as $day){
foreach($data as $i){
if($i['fio']==$name && $i['date']==$day && print("<td>{$i['cha']}</td>"))
continue 2;
}
echo "<td>-</td>";
}
echo "</tr>";
}
echo "</table>";
на выходе будет что-то вроде :