Al-Nadr bin Anas narrates from Sayyiduna Anas (may Allah be pleased with him) that when he boarded a boat and the time of prayer came, if the boat was held at anchor he would pray standing, and if the boat was moving he would pray sitting, in congregation.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5493