I have a table, where the are filled if the user is present.
The JSON to check if he is present :
{"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"}
So he appears in the table if dispo is 1.
Here is a pic of how it looks
And this is how I want it to look :
I want to have a single line per username, and if the user is not available, instead of nothing, a black div.
I have tried in PHP but I can't get the result I want.
So I tried in javascript but the same..
Is javascript a good langage to do what I want ? Or I should try in PHP ?
Thanks
When there is no value, add
. This will fill the table row (empty columns) with empty space.