I'm sorry, I know you're probably not in the mood for humor, but I had to laugh because of the age old excuse "my dog ate my homework". I guess the teacher wouldn't believe the "my dog peed on my homework" excuse.
Seriously though, have you tried spraying a little "bitter apple" on the table to hopefully discourage him from getting up there?
Good luck to you!