First: Tablespoons is a measure of volume, and milligrams is a measure of weight and they cannot be directly converted.Second: A tablespoon is way to large to measure 40 milligrams.Third: However, you can estimate such a conversion for a uniform powdered or granular or liquid substanceFourth: 40 grams of flour is 0.0023 (about 2 one-thousandths) of a tablespoons.It's possible to do the same conversion for salt, sugar, cooking oil, etc.