PHP
1$datas=[
2 ["m_id"=>"A","m_dat"=>"2021-06-04"],
3 ["m_id"=>"B","m_dat"=>"2021-06-01"],
4 ["m_id"=>"C","m_dat"=>"2021-06-02"],
5 ["m_id"=>"D","m_dat"=>"2021-06-02"],
6 ];
7
8$date=array_map(function($x){return date('Y-m-d',$x);},range(strtotime('2021-06-07'),strtotime('2021-06-01'),-60*60*24));
9$list=["A","B","C","D"];
10print "<table border>\n";
11print "<thead>\n";
12print "<tr>\n";
13print "<th> </th>\n";
14foreach($date as $d){
15 print "<th>$d</th>\n";
16}
17print "</tr>\n";
18print "</thead>\n";
19print "<tbody>\n";
20 foreach($list as $l){
21 print "<tr>\n";
22 print "<td>$l</td>\n";
23 foreach($date as $d){
24 $val=count(array_filter($datas,function($x) use($d,$l){
25 return $x["m_id"]==$l and $x["m_dat"]==$d;
26 }))>0?"o":"x";
27 print "<td>$val</td>\n";
28 }
29 print "</tr>\n";
30}
31print "</tbody>";
32print "</table>";