It can be a lot of work to chop up the image into the exactly right pieces. You might want to give Shoestring's Picture Dicer a try. This one does the chopping for you. You can also add some the JavaScript effect in one go. There is still a snake in the grass to be caught.
Some browsers have the nasty trait of adding space around an image in a table cell.
To prevent this from happening both the TD tags need to be directly next to the image, without a line break or a space. This will make your code less attractive, less readable. But at least your page will look the way you set out to do. Have a look at the two sets of blue-orange squares. The html used is exactly the same, apart from the line breaks.