Abu Ghalib reported,

I saw Anas bin Malik perform the funeral prayer over a man. He stood level with the man's head. Then another funeral was brought, that of a woman, and the people said, "Abu Hamza, pray over her."He stood level with the middle of the bier.Ala bin Ziyad asked, "Abu Hamza, is this how you saw the Messenger of Allah ﷺ do it? He stood by the man as you stood by him, and stood by the woman as you stood by her?"Anas replied, "Yes."Then he turned to us and said, "Remember this."

Ibn Majah 1494

Hasan

حدثنا نصر بن علي الجهضمي حدثنا سعيد بن عامر عن همام

عن أبي غالب قال

رأيت أنس بن مالك صلى على جنازة رجل فقام حيال رأسه فجيء بجنازة أخرى بامرأة فقالوا يا أبا حمزة صل عليها فقام حيال وسط السرير فقال العلاء بن زياد يا أبا حمزة هكذا رأيت رسول الله ﷺ قام من الجنازة مقامك من الرجل وقام من المرأة مقامك من المرأة قال نعم فأقبل علينا فقال احفظوا

ابن ماجه 1494حسن
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Funerals
Chapter
Where the imam should stand when praying over the funeral
Numbering
Darussalam 1494
Ibn Majah 1494