If you are trying to build a folding dining room table, it is important that you get the right type of hinges for the job. In this case, you need to purchase leg brackets that are specially designed for this purpose. These brackets will attach to the inner rim of the table and the legs as well. Once they are attached, you should be able to fold the legs as needed. These brackets generally attached to the wood by using screws and a drill. These leg brackets are generally available in most hardware stores and home improvement stores.