diff --git a/app/client/src/pages/Editor/QueryEditor/Table.tsx b/app/client/src/pages/Editor/QueryEditor/Table.tsx index 9dc40037f5..b203296947 100644 --- a/app/client/src/pages/Editor/QueryEditor/Table.tsx +++ b/app/client/src/pages/Editor/QueryEditor/Table.tsx @@ -95,6 +95,8 @@ const Table = (props: TableProps) => { useFlexLayout, ); + if (rows.length === 0 || headerGroups.length === 0) return null; + return ( { ))} ))} - {headerGroups.length === 0 && renderEmptyRows(1, 2)}
{rows.map((row: any, index: number) => { prepareRow(row); @@ -150,7 +151,6 @@ const Table = (props: TableProps) => {
); })} - {rows.length === 0 && renderEmptyRows(1, 2)} @@ -158,38 +158,4 @@ const Table = (props: TableProps) => { ); }; -const renderEmptyRows = (rowCount: number, columns: number) => { - const rows: string[] = new Array(rowCount).fill(""); - const tableColumns = new Array(columns).fill(""); - return ( - - {rows.map((row: string, index: number) => { - return ( -
- {tableColumns.map((column: any, colIndex: number) => { - return ( -
- ); - })} -
- ); - })} - - ); -}; - export default Table;