Isolate the table in a separate file / class / function.
For example:Let it be a function, the output of which is html ready table. File
getDataFromAPI.php contains the function
getDataFromAPI()
.
And
index.php and
new.php include the file:
require_once('getDataFromAPI.php');
Get the html table and insert in the document:
<?php\r$table_html = getDataFromAPI();\recho $table_html;\r?>
More used to cache, probably a good thing.