The Hatter first appears in Lewis Carroll's Alice's Adventures in Wonderland. He turns up again in the sequel, Through the Looking Glass, but his name has been slightly changed to Hatta.
As the Cheshire Cat points out, everyone's mad in Wonderland, and it is true to say that all of the characters are eccentric, at least, and if they weren't, then they wouldn't be there. The phrase...