Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.044A.
It is sunnah for the imam to stand opposite the head of a male body, and opposite the middle of a female body. This is based on a hadith reported from Anas that he offered a funeral prayer for a male standing opposite his head. As soon as the body of the man was removed, a female body was brought in for funeral prayer. He led the prayer standing opposite the middle of her body. Thereupon he was asked, “Did the Prophet, peace be upon him, stand where you stood in the cases of a man and a woman?” He answered: “Yes.” This is narrated by Ahmad, Abu Daw’ud, Ibn Majah and Tirmizhi, who regards it as a sound hadith. Al-Tahawi said: This is the most preferred position, because it is supported by other reports from Allah’s Messenger, peace be upon him.