My kid does this, too, because he follows us. But what we noticed is that when he goes to his grandparents' house, he will sit appropriately at the dinner table with no phone or tv. I think you also need to educate the adults in the house because what they do in their daily life will be imitated by your child. Another way is to train your child that when it’s mealtime, they need to sit at the dinner table. Changes won’t happen in a day, but they will if you keep on practising it