Check the "Settings" of the tablet to make sure that it isn't set up to turn off when charging.
You should also check that no app is the cause of this.
Should neither of those change anything, try using a different charger and see if it works while charging. If it does, your charger is the problem. If not, it may be time for a new battery.