It seems that you are having onycholysis.
There may be some cause.
Fungal infection is major cause. Consult dermatologist
.he will examine nail properly.KOH test for fungus might be done. If positive anti fungal like itraconazole or ketoconazole may be prescribed by him.
Othe systemic causes like hyperthyroidism,amyloidosis connective tissue
internal infections..etc should be ruled out.
Local diseases like eczema,psoriasis ,sarcoidosis,scleroderma,atopic dermatitis
.. etc may be excluded.
Poor immunity or nutritional deficiency
may be responsible .
Senile age should be kept in mind.
Avoidance of injury to affected toe is required.
I hope you got my answer..
Dr.Ilyas Patel MD