derekeder/csv-to-html-table

More then one csv file

Opened this issue · 3 comments

How can you show up more then 1 csv file from the data folder ?
Thanks in advance !

I had the same question. The solution is in issue #49

I think this is a better solution:

In the index.html between the "container-fluid" div tags create as many divs as tables you need and make sure you use different id names for each div/table.:

<div class="container-fluid">  
        <div id="rn-table_1"></div>
        <div id="rn-table_2"></div>
        <div id="rn-table_3"></div>
<div class="container-fluid"> 

Then between the <script type="text/javascript"> </script> tags use the following code.

Replace names in rnTable according to the id names of the divs you just created and the.
Replace the paths in rnCSV according to the paths of your CSV files.

Make sure they are in order with the tables. For example 'data/next_release_1.csv' corresponds to 'rn-table_1' and is in the same order in the array

  var rnCSV = ['data/next_release_1.csv', 'data/next_release_2.csv', 'data/next_release_3.csv'];
  var rnTable = ['rn-table_1', 'rn-table_2', 'rn-table_3'];

  for (var i = rnCSV.length - 1; i >= 0; i--) {
    
      rnCSV[i];
      rnTable[i];

      CsvToHtmlTable.init({           
      csv_path: rnCSV[i],
      element: rnTable[i], 
      allow_download: true,
      csv_options: {separator: ',', delimiter: '"'},
      datatables_options: {"paging": false},
      custom_formatting: [[4, format_link]]
    });
  }

hello, would anyone know how could I display this multiple tables with different buttons ?

Thanks in advance.