12 AWG wire can support up to 45A...if the run is very, very short, voltage drop isn't a concern, and it doesn't ever pass through an engine room.
To get to a 45A rating on a table, you'd probably have to be looking at 7 or 8 feet of total circuit length, an unbundled run, 10% voltage drop being okay, and never touching an engine room space.
Maybe the 10% drop is okay for a heater. I am skeptical that the wiring will never pass through an engine room. And, if have no idea if you are bundling the wires with others or not.
And, I really suspect you are miss reading the table for length. I can barely get out of my panel with 7-8ft.
Before looking up the length in the table, measure the run, including all of the bends, etc -- and then double it.
The tables use the circuit length, not the wire length. For AC this means the sum of the length of the black and white wires, combined. For DC this means the same or the red and black/yellow wires combined.
A 15ft unbundled run, which is a 30ft circuit running at any point through the engine room and required to supply 30 at no more than 10% drop would require 10 AWG.
If the wires are bundled, another aggressive derating needs to happen. If the circuit needs to have less than a 10% tolerance for voltage drop, another delegating needs to happen.
West Marine has this nice table with info about how to derate so you can verify what I write (always necessary) and find a solution given your actual situation.
https://www.westmarine.com/west-advisor/Marine-Wire-Size-And-Ampacity.html