我有一张桌子,如果有用户在的话,会在其中填满。
检查他是否存在的JSON:
{"prenom":"Guillaume","nom":"HUART","date":"01-01-2019","heure":"06:00:00","dispo":"1","id":"1"},{"prenom":"Guillaume","nom":"HUART","date":"01-01-2019","heure":"07:00:00","dispo":"1","id":"1"},{"prenom":"Guillaume","nom":"HUART","date":"01-01-2019","heure":"08:00:00","dispo":"1","id":"1"},{"prenom":"Guillaume","nom":"HUART","date":"01-01-2019","heure":"09:00:00","dispo":"1","id":"1"},{"prenom":"Guillaume","nom":"HUART","date":"01-01-2019","heure":"10:00:00","dispo":"1","id":"1"}
因此,如果dispo为1,他就会出现在表格中。
这里是它的外观图片
这就是我想要的样子:
我希望每个用户名只有一行,如果用户不可用,则用黑色的div代替。
我已经在PHP中尝试过,但无法获得想要的结果。
所以我尝试使用javascript,但还是一样。
javascript是执行我想要的语言的好语言吗?还是我应该尝试使用PHP?
谢谢
答案 0 :(得分:0)
如果没有值,请添加
。这将在表行(空列)中填充空白空间。