Shortcode result appears above page content

You should use output control functions if you want to do it this way:

function cotizador_shortcode($atts)
{
    ... your code here ...
    ob_start();
?>

<!-- THE CODE BELOW SHOULD APPEAR IN THE PAGE CONTENT AS A TABLE -->

... HTML here ...

<?php
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
add_shortcode('cotizador', 'cotizador_shortcode');

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)