Search Ebay for USB Power Amp MeterTest Charger, around $3 to $6, this way it will tell you if your cable or adapter is working.
https://rover.ebay.com/rover/1/711-5...r%26_sacat%3D0
If both work you should have a current around 1.7 Amperes and voltage is around 5.3 Volts . If both readings are correct and the battery is not holding charge or the reading goes up and down, then possibly the problem is cracks solders of battery connector. You may need a magnified glass to look and inspect, if it's moving when you're pushing slightly by a screw driver, do it if you know how to solder, then it needs to re solder to fix the loose connection . A repair shop may help you , it takes only less than 5 minutes to do the re work.
You tablet can only run when connected to charger is a good indication that it cannot run or not enough power from battery due to loose connection.