Nice table. I would attach the shelf securely to the front rail and loosely to the rear tail. I would probably put one screw near the center of the rear rail and depend on the rail to bend to accommodate seasonal movement of the shelf or use table top clips. I probably would leave an 1/8" clearance inside the rear legs. If the cross section of the legs allows I would cut mortises or slots in the legs to tuck the shelf into to cover the movement.