Read the endings and the grammatical relationship, not only the word لَا.
Working like laysa: لَا رَجُلٌ صَالِحًا
The ism رَجُلٌ is marfu; the khabar صَالِحًا is mansub.
Negating the whole class: لَا رَيْبَ فِيهِ
The ism رَيْبَ is built on fathah in the position of nasb and appears without tanwin.
These are two simple cases, so a direct comparison is clearer than a table.