<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-html5-1.5.6/b-print-1.5.6/datatables.min.css"/>
 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-html5-1.5.6/b-print-1.5.6/datatables.min.js"></script>
    
    <meta charset=utf-8 />
  </head>
  <body>
      <table id="example" width="100%">
        <thead>
          <tr>
            <th>Name</th>
            <th>large_integer</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>Tiger Nixon</td>
            <td>92001902416755000004290987</td>
          </tr>
            <tr>
            <td>Tiger Nixon</td>
            <td>66874544651124549971215615</td>
          </tr>
        </tbody>
      </table>
  </body>
</html>
 
 $(document).ready(function() {
            var table = $('#example').DataTable({
                dom: 'Bfrtip',
                columnDefs: [{
                    targets: 1,
                    type: 'text',
                }],
                buttons: [{
                    extend: 'excelHtml5',
                    exportOptions: { orthogonal: 'export' },
                    customize: function(xlsx) {
                        var sheet = xlsx.xl.worksheets['sheet1.xml'];
                        // Select column B and apply formatting
                        $('row c[r^="B"]:not(:first)', sheet).attr('t', 'str');
                    }
                }]
            });
        });
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers