Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More then one csv file #66

Open
urbanswelt opened this issue Oct 19, 2018 · 3 comments
Open

More then one csv file #66

urbanswelt opened this issue Oct 19, 2018 · 3 comments

Comments

@urbanswelt
Copy link

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

@feedhandler
Copy link

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

@zackVC
Copy link

zackVC commented Feb 1, 2019

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]]
    });
  }

@sedado22
Copy link

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

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants