public static function outputDebugStackTable()
    {
        self::prepareTraceStack();

        // For terminals
        if (IS_CLI || IS_AJAX_REQUEST) {
            foreach (self::$trace_stack as $step) {
                echo 'Class: ' . (isset($step['class']) ? $step['class'] . $step['type'] : '') . $step['function'] . '<br>';
                echo "\n";

                echo 'File: ' . ($step['file'] ?? '') . ':' . ($step['line'] ?? '') . '<br>';
                echo "\n\n";
            }

            return;
        }

        ?>
        <style>
            table {
                border-collapse: collapse
            }

            .trace_table td {
                padding: 5px 15px;
            }

            .trace_table tr:hover {
                background-color: lightgrey;
            }

            .liner_right {
                border-right: 1px solid lightgrey;
            }

            .liner_bottom {
                border-bottom: 1px solid lightgrey;
            }
        </style>

        <table class="trace_table" width="100%">
            <tr>
                <td class="liner_right liner_bottom"><strong>Class and method</strong></td>
                <td class="liner_right liner_bottom"><strong>File</strong></td>
                <td class="liner_right liner_bottom"><strong>Line</strong></td>
            </tr>
            <?php
            $dir_base_length = strlen(DIR_BASE) - 1;

            foreach (self::$trace_stack as $step) {
                echo '<tr>
                    <td>' . (isset($step['class']) ? '' . $step['class'] . '' . $step['type'] : '') . '' . $step['function'] . '</td>
                    <td>' . (isset($step['file']) ? substr($step['file'], $dir_base_length) : '') . '</td>
                    <td>' . ($step['line'] ?? '') . '</td>
                </tr>';
            }
            ?>
        </table>
        <?php
    }