Skip to content

Commit

Permalink
add results table to html
Browse files Browse the repository at this point in the history
  • Loading branch information
wmentrekin committed Oct 27, 2020
1 parent 1a24598 commit a646cec
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,25 @@ <h2>Average Margin of Victory</h2>
<img src="map.png" alt="Average Margin of Victory" width="800" height="536">
</div>

<div id="CSVTable"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//jquerycsvtotable.googlecode.com/files/jquery.csvToTable.js"></script>

<script>
$(function() {
$('#CSVTable').CSVToTable('/results/full_results.csv');
});
</script>
<table>
<tr>
<td>Header 1</td>
<td>Header 2</td>
</tr>
<?php
$fp = fopen ( "file.csv" , "r" );
while (( $data = fgetcsv ( $fp , 1000 , "," )) !== FALSE ) {
$i = 0;
echo "<tr>";
foreach($data as $row) {
echo "<td>" . $row . "</td>";
$i++ ;
}
echo "/<tr>";
}
fclose ( $fp );
?>
</table>

</body>

Expand Down

0 comments on commit a646cec

Please sign in to comment.