goto different page using form button in html in flask code example
Example: Howt o get redirected to another page using a button in HTML using Python using Flask
<button type="button" onclick="window.location.href='{{ url_for( 'dataTablePage' , table='Y' ) }}';">Display Table Y</button>