Didn't you take wood-work at school??
A cleat is a narrow piece of wood, prolly about 25mm to 50mm wide, 25mm thick,and approx 400mm long,
not "L" shaped, rectangular.
and running under, and hard up against the underside of the shelf.
PVC glue, and screw, this to the walls of the table, and the glued to the underside of the table-top.
It will then make a better support for the ends of the table-top.
Also make sure to add more nails to the back cover of the unit.
This (the backing)acts as a brace for the unit.
You'll need extra fastenings on the whole perimeter of the backing,
as well as the walls that go thru from front to back.
Failure to do this, could result in the whole thing collapsing in a sideways, diagonal movement.
Alan 104