If your puppy spends time near the dinner table, he likely has good reasons for it. For a start, everything you put on the dinner table smells heavenly to a sensitive puppy's nose. Next, those random crumbs are tempting treasures that make going near the table a remarkably rewarding event.
Determine what makes the dinner table so attractive. Are you unable to resist those pleading eyes and end up feeding table scraps when you are eating? Are you brushing crumbs off of the table after dinner, creating a fun treasure hunt? Are you allowing your pup to lick bits of food off your plate? Are you giving permission to eat anything that drops from the table? While your puppy may be attracted to the dinner table naturally, there are things you may be doing that will make the table further attractive.
Change the behaviors that are "feeding" the behavior of hanging around the dinner table. In other words, stop feeding table scraps at the table. Those leftover foods are quite unhealthy for his digestive system anyhow. Also, try your best to avoid crumbs from falling to the floor and giving your puppy the chore of making your dishes spotless with his tongue. With less attractive events taking place near the table, after some time your puppy should feel less inclined to linger around.
Puppies often are told what not to do, but what about telling them what to do instead? Establishing good table manners at an early age is best. Train your puppy to stop hanging around the dinner table by teaching him to go to his mat instead. Place a mat on the floor at a distance from the table and place a puppy Kong stuffed with treats on it. Your puppy will lie down on the mat and will stay busy getting the goodies out of the toy. If you repeat this every day, you will establish a routine and your puppy will only make good choices, since staying on the mat is much more rewarding that hanging by a boring table where not many great things are happening anymore.