Abu Ghalib narrated that Sayyidina Anas ibn Maalik (RA) was leading the funeral salah of a man, and stood in line with his head. Then the funeral of a Qurayshi woman was brought. The men said, ‘0 Abu Hamzah, pray over her,” so he stood in line with the centre of the body. On that, Ala ibn Ziyad asked him, “Had you seen Allah’s Messenger (SAW) stand in this manner at your place in her funeral (where you stood) and at your place in his funeral (where you stood)?” He said, ‘Yes,” and when it was over, “Remember it!”
[Abu Dawud 3194, Ibn e Majah 1494]