only display table if it has a nonzero number of rows

This commit is contained in:
pantonshire committed 2023-06-15 14:34:34 +01:00
1 parent eb6dfea3db
commit 3f3b9d0b9e
1 file changed
+13 -3
+13 -3
View File
@@ -67,9 +67,10 @@ export function OutputTable(props: { currentString: string }) {
} }
} }
return ( let table;
<section className={styles.table_container}>
<div className={styles.overflow_scroll}> if (rows.length > 0) {
table = (
<table id={styles.output_table}> <table id={styles.output_table}>
<thead> <thead>
<tr> <tr>
@@ -93,6 +94,15 @@ export function OutputTable(props: { currentString: string }) {
{rows} {rows}
</tbody> </tbody>
</table> </table>
);
} else {
table = (<></>);
}
return (
<section className={styles.table_container}>
<div className={styles.overflow_scroll}>
{table}
</div> </div>
</section> </section>
); );