How did the treasure end up on Widow Douglas's table?
Tom has poured the treasure on the table. (Ch 23 & 24).
The boys had discovered it under the cross in Injun Joe's cave. The chest was too heavy to carry, so the Huck and Tom put it in bags. The put the bags on a skiff and pull them back.
The Welshman (Mr. Jones) unwittingly helps the boys pull in the heavy treasure. Sid tells Tom and Huck that the Widow Douglas is giving a party for Jones and his sons, as she believes it is he who had saved her from Injun Joe. The Welshman plans to tell the assembled guests at the party that Huck is the true hero, but Sid spoils it by telling first.
The widow tries to look surprised and says that all along she'd been planning on taking care of Huck financially. Tom has his own surprise: he shouts, "Huck's rich!" To prove it, he pours it out on the table, to everyone's utter astonishment.