As Uwe said, this has been discussed endlessly. I mention a strategy in my 2013 InDesignSecrets article: https://indesignsecrets.com/tackling-tables-through-scripting.php -- first, tighten all columns as much as possible, then divide the remaining space over the columns.
Here is your sample table 1:
but it does not work nicely for that huge rotated table 2 (presumably because to fit, all lines need to wrap; you will have to think of something for that on your own). A nicer example is your table 3, where everything fits on a single line, with room to spare:
... View more