Problems charging Android tablets usually stem from either the charger or the charging port itself. If you notice your tablet isn't charging, set it to Airplane Mode and reduce the brightness to extend the battery life while you work to solve the problem. Back up your files while you can, in case the problem can't be solved at home.
Some users have experienced issues with charging the battery on the Samsung Galaxy Tab. The unit stops recognizing that the battery is connected and, thus, refuses to charge it. This is grounds for a replacement, if your product is still under warranty. In fact, it's better to swap it out for a new product than to attempt to repair it yourself, so that you don't void any warranties. If your product isn't under warranty, pry off the back of the case, unplug the battery connector and then plug it back in. When you've replaced the case, plug the Tab back in to the charger.
To troubleshoot your Nexus 7, plug it into the wall charger for one minute without using it. Next, press and hold the power button for 15 seconds, then release it. Leave the Nexus plugged in for one hour without disturbing it. Then unplug the tablet and plug it back into the charger immediately. Press and hold the power button for 15 seconds again. Leave it to charge for at least ten hours. When the time is up, unplug it, plug it back in quickly and then press and hold the power button for 15 seconds. When the process is complete, try using the Nexus again.
Sometimes the problem is with the charging port of the tablet itself. Examine it to see whether it's bent or misshapen. The connector on the charging cable needs to be able to fit well, so that all the pins on the charger are correctly attached to those on the port. If your port is damaged, it may need to be fixed or the entire unit may need to be replaced. You should also check the connector on the charging cable to make sure that port is correctly shaped and not damaged.
Sometimes using an incorrect power adapter can prevent a tablet from charging. Look at both the base of the adapter that plugs into an outlet and the cable itself. Very long extension microUSB cables, for example, charge more slowly than shorter OEM cables. Check the manual that came with your tablet to see what type of charger you need. If you're charging the tablet from a computer USB port, it may prevent the tablet from charging correctly. Use a wall adapter and see if it fixes the problem.