diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index d0cc3d6..e82b7e5 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -558,6 +558,7 @@ define(
 
           grid_columns.push(checkboxSelector.getColumnDefinition());
 
+        var new_width = (columns.length * 150);
         _.each(columns, function(c) {
             var options = {
               id: c.name,
@@ -592,7 +593,9 @@ define(
           enableCellNavigation: true,
           enableColumnReorder: false,
           asyncEditorLoading: false,
-          autoEdit: false
+          autoEdit: false,
+          minWidth: 150,
+          forceFitColumns: true
         };
 
         var $data_grid = self.$el.find('#datagrid');
@@ -600,6 +603,14 @@ define(
         var grid_height = $($('#editor-panel').find('.wcFrame')[1]).height() - 35;
         $data_grid.height(grid_height);
 
+        /* Check the new width is greater than actual width. If
+         * yes then set the width of panel to new width.
+         */
+        var grid_width = $($('#editor-panel').find('.wcFrame')[1]).width()
+        if (new_width > grid_width) {
+          $data_grid.width(new_width);
+        }
+
         // Add our own custom primary key to keep track of changes
         _.each(collection, function(row){
           row['__temp_PK'] = epicRandomString(15);
