What is the verdict on praying Jamaa' and some rows divided by pillars?
Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
The Prophet (Sallallahu Alaihi wa Sallam) encouraged standing tightly together in rows and not living any gap between the praying people. He said: “Be compacted in rows." Al-Hakim reported it and graded it as sound, Imam al-Zahabi agreed with him. The Prophet also said: “Straighten your rows, adjoin the shoulder with the shoulder (of the one who is next to him), be tender to your brothers and fill the gaps. Indeed, Satan penetrates the rows (gaps).” [Ahmad and al-Tabrani, Sheikh al Albani graded it as Saheeh]
It is proved from Anas Bin Malik that he said: “We were prohibited from performing prayers between pillars in the period of the Prophet (Sallallahu Alaihi wa Sallam) and we used to be driven away from staying between pillars.” [Reported by Ibn Majah, al-Hakim and Sheikh al-Albani graded it as sound.]
There is a general rule that whenever a companion of the Prophet (Sallallahu Alaihi wa Sallam) says, "We used to do in the period of the Prophet (Sallallahu Alaihi wa Sallam)," it means that he referred to the rulings of the Prophet (Sallallahu Alaihi wa Sallam).
Based on the above Ahadith al-Malikiyah and al-Hanabilah are of the opinion that making rows between pillars is dislikeable, Imam al-Shawkani also preferred this opinion. But Al-Ahnaf and al-Shaafia are of the opinion that it is permissible.
However, all the scholars are agreed that there is no harm to make the rows between pillars at the time of necessity.
You can search for fatwa through many choices