The command to make the rows straight was narrated in many well-known ahaadeeth, including the words of the Prophet (peace and blessings of Allaah be upon him): “Make your rows straight, for straightening the rows is part of perfecting the prayer.” Narrated by al-Bukhaari (723) and Muslim (433) from the hadeeth of Anas (may Allaah be pleased with him).
And he (peace and blessings of Allaah be upon him) said: “Either you straighten your rows or Allaah will create discord among you.” Narrated by al-Bukhaari (717) and Muslim (436) from the hadeeth of al-Nu’maan ibn Basheer (may Allaah be pleased with him).
Some scholars are of the view that it is obligatory to make the rows straight, because when the Prophet (peace and blessings of Allaah be upon him) saw a man whose chest was sticking out (from the row) he said: “Slaves of Allaah! Make your rows straight or Allaah will cause discord among you.” This is a warning, and there is no warning except with regard to a haraam action or failure to do an obligatory action. The view that it is obligatory to straighten the rows is a strong view. End quote from Fataawa al-Shaykh Ibn ‘Uthaymeen (13/question no. 375).
So the imam should tell the people to straighten the rows, and he should take care of that.
As for putting lines on the mats or carpets to help make the rows straight, there is nothing wrong with that, and it is not an innovation.
The scholars of the Standing Committee were asked: What is the ruling on making lines on the mats or carpets in the mosque, because the qiblah is not square with the building, to help organize the rows?
They replied: There is nothing wrong with that, and if they pray without a line there is nothing wrong with that either, because a slight deviation from the qiblah does not matter.
Shaykh ‘Abd al-‘Azeez ibn ‘Abd-Allaah ibn Baaz and Shaykh ‘Abd al-Razzaaq ‘Afeefi.
Fataawa al-Lajnah al-Daa’imah (6/315).
Shaykh ‘Abd al-Razzaaq ‘Afeefi (may Allaah have mercy on him) was asked about the ruling on drawing lines in the mosques to make the rows straight.
He replied: If the people cannot make their rows straight except by means of that, there is nothing wrong with that, or if the mosque was built slightly off from the qiblah and the rows cannot made be straight except by means of that, there is nothing wrong with it in sha Allaah. End quote from Fataawa wa Rasaa’il al-Shaykh ‘Abd al-Razzaaq ‘Afeefi (p. 412).
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said: Bid’ah (innovation) means worshipping Allaah in a manner other than He has prescribed. Based on this, bid’ah does not have to do with matters other than worship, rather things that are introduced with regard to worldly matters should be examined to see if they are halaal or haraam, but it cannot be said that they are bid’ah. In sharee’ah terminology, bid’ah refers to when a person worships Allaah in a manner other than that which He has prescribed. As for worldly innovations, although they may be called innovations in linguistic terms, they are not innovations in religious terms in the sense that they cannot be ruled to be haraam, halaal, obligatory or mustahabb unless there is shar’i evidence to that effect. Based on that, we cannot say that the things that people invent nowadays to make it easier to do acts or worship are bid’ahs even if they did not exist before, such as loudspeakers. Loudspeakers did not exist at the time of the Prophet (peace and blessings of Allaah be upon him), rather they were invented recently, but they serve a religious purpose by conveying to the people the prayer, recitation and khutbah of the imam. Similarly in lectures they serve a useful purpose, so they are good, and buying them for the mosque for this purpose is something that is prescribed and for which a person will be rewarded.
Another example is the recent development of having carpets in our mosques in which there are lines so that the rows may be made straight. Even though this is something new, it is a means of doing something that is prescribed in sharee’ah, so it is permissible or allowed for a purpose. It is well known to the people that the imams were keen to straighten the rows and they paid attention to that before these lines came along, and they would face some problems, such as if someone stood too far forward, they would tell him to go back, and if someone stood too far back, they would tell him to come forward, and if necessary to come further. That took a lot of effort. But now, praise be to Allaah, the imam can say: Make your rows straight along the lines, and the rows can be organized properly. This is an innovation in the sense that it is something new, but it is not an innovation in shar’i terms, because it is a means of achieving something that is required by sharee’ah. End quote from Fataawa Noor ‘ala al-Darb.
The one who is not convinced of this argument and persists in the view that it is a bid’ah to put lines in the mosque should explain his view to the imam, by way of offering sincere advice, then he should refrain from stirring up disputes in the mosque, because if the imam has put lines in the mosque, he is following an acceptable opinion, so there is no room for denouncing him, rather this is the correct view as stated above.
And Allaah knows best.