Separate the table leg from the table, removing any hardware if necessary. If the leg is held in place with dowels, remove the dowels until you are ready to glue.
Clean off any old glue using a knife, sandpaper or a file. It is not necessary to get all the residue off, as long as there is a smooth surface where the wood surfaces will join together.
Put the table leg in place as a dry run, making sure that everything fits before you add glue to the joint. Take it back apart.
Paint the surface of the joint where the table leg joins with the top of the table. Pay special attention to the sides of the wooden leg near the end more than the end surfaces of the leg, since glue will not hold end fibers with any strength. Use a small paint brush and carpenters’ wood glue to paint the surfaces, including the dowels.
Put the joint together while the glue is wet. Add the hardware and tighten everything in place. If you do not have hardware holding the joint together, clamp the table leg to the table for 24 hours while the glue dries. Wipe off any excess glue with a damp rag.