battery charging

Why not an inverter powered from a constant 12v source and plug in the tablet's charger there? How would you control the charging rate to the gel battery?