Although this quotation is not included in the online document titled The Table Talk of Martin Luther, it would seem to be genuine. First of all, evidence of Luther's beliefs can be found in paragraph DCCXCVII of that document:
Astronomy is the most ancient of all sciences, and has been the introducer of vast knowledge; it was familiarly known to the Hebrews, for they diligently noted the course of the heavens, as God said to Abraham: "Behold the heavens; canst thou number the stars?" etc. Haven's motions are threefold; the first is, that the whole firmament moves swiftly around, every moment thousands of leagues, which, doubtless, is done by some angel. 'Tis wonderful so great a vault should go about in so short a time. If the sun and stars were composed of iron, steel, silver, or gold, they must needs suddenly melt in so swift a course, for one star is greater than the whole earth, and yet they are innumerable. The second motion is, of the planets, which have their particular and proper motions. The third is, a quaking or a trembling motion, lately discovered, but uncertain. I like astronomy and mathematics, which rely upon demonstrations and sure proofs. As to astrology, `tis nothing. [My emphasis]
Christopher B. Kaiser (Creational Theology and the History of Physical Science), page 185, tells us Luther's comments were based on dinner table conversations. He says Anthony Lauterbach, who dined with Luther, recorded the following comments from Luther:
So it goes now. Whoever wants to be clever must agree with nothing that others esteem. He must do something on his own. This is what that fellow does who wishes to turn the whole of astronomy upside down. Even in these things that are thrown into disorder I believe the Holy Scriptures, for Joshua commanded the sun to stand still and not the earth
[Josh. 10:12]
Kaiser says
Clearly the issue for Luther was not a technical question of the merits of the heliocentric theory, but the seeming ambition ofthe astronomer and the possible disruptive effect his teachings might have on a Christian society.
Calvin's comments are attrbuted to his 'Sermon on 1 Corinthians 10:19-24'.