<td colspan="2" align="center">
    <h2>{$params_tpl['title']}{$params_tpl['help']}</h2>
    <div style="display: flex; flex-direction: column;">{$tpl_types['res_field']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['sub_table']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['sub_record']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['add_value']}</div>
    <div style="display: flex; flex-direction: column;" id="add_delim">{$tpl_types['add_delim']}</div>
</td>
<script>
(function() {
    var resField = $('[name="calc_params[{$tpl_num}][res_field]"]');
    function resFieldChange() {
        var fieldType = resField.children('option[value="' + resField.val() + '"]').attr('data-type');
        $('#add_delim').toggle(fieldType != 6);
        if (fieldType == 6) {
            $('[name="calc_params[{$tpl_num}][add_delim]"]').val('\\r\\n');
        }
    }
    $(document).ready(resFieldChange);
    resField.change(resFieldChange);
})();
</script>