There are two ways in which your dog might get food from the table. He may steal food from the table when your are not looking, a huge problem if the table is laid for some formal holiday feast and your dog decides to help himself to the turkey and stuffing! Or, your dog may beg at the table incessantly, until someone in the household breaks down and gives him food from the table, which only reinforces the behavior.
Scavenging for food and following his nose are natural behaviors for your dog, and it is the owner's responsibility to teach their dog what is and isn't appropriate food for him to consume and in what circumstances. There are several problems with your dog taking food from the table. Besides that many people find begging at the table to be disruptive to meal times, unsanitary, and annoying, having your dog take food from a tabletop or counter without permission can ruin a planned family meal. Also, this behavior can be dangerous for your dog--often human food like poultry or fish containing bones can be a health hazard to your dog, and some human foods are toxic to dogs, including grapes, chocolate, and some fruits and vegetables. Another health concern is that a dog that becomes reliant on human food may not have his dietary requirements properly met, as a human diet is not appropriate for a dog.
There are several ways to prevent counter or table surfing or begging at the table before it begins. Teaching your dog to eat his food at his designated location from the beginning, and not feeding scraps or human food, will diminish his interest in your diet, and usually establish that his food is his, and yours is yours. Preventing your dog from opportunistically discovering human food, by keeping him away from the table at meal times and in between and putting food away is recommended. Also, you can use doors and gates to keep your dog away from areas where human food is present, making it inaccessible, to prevent your dog eating from the table in the first place. Punishing a dog for table or counter surfing is usually ineffective because by the time the transgression is discovered, it is too late and the dog will not associate the punishment with the food stealing behavior, besides he already received a reward for that behavior: some delicious food!
While training, make sure that your dog is not tempted to steal or beg for food, by removing access to food left around the house, access to the kitchen, or access to mealtime with the family. If your dog is able to take food from the table it will reinforce his food snatching ways and undermine what you are trying to accomplish. You will need alternatives to eating from the table, which may involve changing your schedule so your dog eats at the same time as you, in his own area, or providing alternatives such as chew bones during mealtime. Also, using treats to teach your dog the 'leave it' command is useful for stopping table eating, and applies to a host of other food stealing behaviors, such as stealing another dog's food or rummaging through the garbage. Noise making devices to deter your dog from stealing food, and a foul-tasting non-toxic substance to lace food with, can also be used to create a negative association with stolen people food.