diff --git a/misc-scripts/sql2html.pl b/misc-scripts/sql2html.pl
index 43f969c825a18a61aa32036e59ad6c47121ef0bb..068c33e91873cf90bc3301cce8dea18f8dfbbf39 100644
--- a/misc-scripts/sql2html.pl
+++ b/misc-scripts/sql2html.pl
@@ -579,16 +579,9 @@ sub display_tables_list {
           $t_count = 0;
         }
       }
-      $html .= qq{      </ul>};
+      $html .= qq{\n      </ul>};
       $html .= qq{\n      </div>} if ($count > $nb_by_col);
-      
-      if ($format_headers == 1) {
-        $html .= qq{  </div>\n};
-        if ($nbc > 1) {
-          $html .= qq{  <div style="clear:both" />\n</div>\n\n<div>};
-          $nb_col_line = 0;
-        }
-      }    
+      $html .= qq{\n    </div>\n} if ($format_headers == 1);   
     }
     else {
       $html .= qq{\n    <table style="padding:0px 2px"><tr><td>\n      <ul style="padding-left:20px">\n};