<!DOCTYPE html>
<html>
  <head>
   <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
    <link href="https://cdn.datatables.net/2.2.2/css/dataTables.bootstrap5.min.css" rel="stylesheet">
    <link href="https://cdn.datatables.net/2.2.2/css/dataTables.dataTables.css" rel="stylesheet">
    <link href="https://cdn.datatables.net/buttons/3.2.2/css/buttons.dataTables.css" rel="stylesheet">
    <link href="https://cdn.datatables.net/responsive/3.0.4/css/responsive.bootstrap5.min.css" rel="stylesheet">
    
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.datatables.net/2.2.2/js/dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/2.2.2/js/dataTables.bootstrap5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/3.2.2/js/dataTables.buttons.js"></script>
    <script src="https://cdn.datatables.net/buttons/3.2.2/js/buttons.dataTables.js"></script>
  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/3.2.2/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/responsive/3.0.4/js/dataTables.responsive.min.js" integrity="sha384-A6In5tKqlvPZKDpH+ei4A3A4TZrEsyvvN2Fe+oCB1IaQfGD5HNqDIxwjztNKSGDd" crossorigin="anonymous"></script>
    <script src="https://cdn.datatables.net/responsive/3.0.4/js/responsive.bootstrap5.js" integrity="sha384-hyp/YDWGBMFqg7pJuS+y+2VWJkwnOyX+oMN9fWcxINo2flqjC/SdNaHj8LIV4zKJ" crossorigin="anonymous"></script>
    
    <title>DataTables - JS Bin</title>
  </head>
  <body>
   <div class="content container">
   
   
     <div class="card">
        <div class="card-body">
            <table id="projectTable" class="table nowrap">
                <thead>
                    <tr>
                        <th width="15%" colspan="1" data-dt-order="disable"></th>
                        <th width="15%" colspan="1" data-dt-order="disable"></th>
                                <th colspan="10" class="text-center" data-dt-order="disable">
                                    2025
                                </th> 
                                <th colspan="10" class="text-center" data-dt-order="disable">
                                    2026
                                </th>
                                <th colspan="10" class="text-center" data-dt-order="disable">
                                    2027
                                </th>
                        <th colspan="2" data-dt-order="disable">
                        </th>
                    </tr>
                    <tr>
                        <th colspan="1" data-dt-order="disable"></th>
                        <th colspan="1" data-dt-order="disable"></th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q1</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q2</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q3</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q4</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Total</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q1</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q2</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q3</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q4</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Total</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q1</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q2</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q3</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Q4</th>
                        <th colspan="2" data-dt-order="disable" style="text-align:center">Total</th>
                        <th colspan="2" data-dt-order="disable"> Overall Total</th>
                    </tr>
                    <tr>
                        <th width="15%" colspan="1">Status</th>
                        <th width="20%" colspan="1">Project Name</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Forecast</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Forecast</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Actual</th>
                        <th>Target</th>
                        <th>Forecast</th>
                        <th>Target</th>
                        <th data-dt-order="disable"></th>
                        <th data-dt-order="disable"></th>
                    </tr>
                </thead>
                <tbody>
                        <tr>
                            <td>
                                <span class="badge bg-success circle-badge-success"></span>
                                <span style="display:none;">On Track</span>
                            </td>
                            <td>Metamorphosis</td>
                            <!-- Dynamic Yearly Data -->
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                Growth
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-warning circle-badge-warning"></span>
                                <span style="display:none;">At Risk</span>
                            </td>
                            <td>Ignite</td>
                            <!-- Dynamic Yearly Data -->
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                Growth
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-danger circle-badge-danger"></span>
                                <span style="display:none;">Off Track</span>
                            </td>
                            <td>Phoenix</td>
                            <!-- Dynamic Yearly Data -->
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                Growth
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-success circle-badge-success"></span>
                                <span style="display:none;">On Track</span>
                            </td>
                            <td>Elevate</td>
                            <!-- Dynamic Yearly Data -->
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                COGS
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-warning circle-badge-warning"></span>
                                <span style="display:none;">At Risk</span>
                            </td>
                            <td>Evolve</td>
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                COGS
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-danger circle-badge-danger"></span>
                                <span style="display:none;">Off Track</span>
                            </td>
                            <td>Serve</td>
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                COGS
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-success circle-badge-success"></span>
                                <span style="display:none;">On Track</span>
                            </td>
                            <td>Zion</td>
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                GBS
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-warning circle-badge-warning"></span>
                                <span style="display:none;">At Risk</span>
                            </td>
                            <td>Triumph</td>
                            
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                GBS
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="badge bg-danger circle-badge-danger"></span>
                                <span style="display:none;">Off Track</span>
                            </td>
                            <td>Thrive</td>
                            <!-- Dynamic Yearly Data -->
                                <td>29.00</td>
                                <td>27.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <!-- Total Forecast and Target for each year -->
                                <td>77.00</td>
                                <td>82.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                
                                <td>97.00</td>
                                <td>102.00</td>
                                <td>49.00</td>
                                <td>47.00</td>
                                <td>48.00</td>
                                <td>55.00</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>97.00</td>
                                <td>102.00</td>
                            <td>271.00</td>
                            <td>
                                GBS
                            </td>
                        </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
  </body>
</html>
 
body {
  font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #fff;
}
table {
  table-layout: fixed;
}
.circle-badge {
            width: 20px; /* Set width of the circle */
            height: 20px; /* Set height of the circle */
            border-radius: 50%; /* Make it a perfect circle */
            display: inline-block; /* Ensure it's displayed inline */
            background-color: #28a745; /* Use success color (green) */
        }
        .circle-badge-info {
            width: 20px; /* Set width of the circle */
            height: 20px; /* Set height of the circle */
            border-radius: 50%; /* Make it a perfect circle */
            display: inline-block !important; /* Ensure it's displayed inline */
            background-color: #2cbacc; /* Use success color (green) */
        }
        .circle-badge-success {
            width: 20px; /* Set width of the circle */
            height: 20px; /* Set height of the circle */
            border-radius: 50%; /* Make it a perfect circle */
            display: inline-block !important; /* Ensure it's displayed inline */
            background-color: #28a745; /* Use success color (green) */
        }
        .circle-badge-warning {
            width: 20px; /* Set width of the circle */
            height: 20px; /* Set height of the circle */
            border-radius: 50%; /* Make it a perfect circle */
            display: inline-block !important; /* Ensure it's displayed inline */
            background-color: #f58646; /* Use success color (green) */
        }
        .circle-badge-danger {
            width: 20px; /* Set width of the circle */
            height: 20px; /* Set height of the circle */
            border-radius: 50%; /* Make it a perfect circle */
            display: inline-block !important; /* Ensure it's displayed inline */
            background-color: #ef5350; /* Use success color (green) */
        }
 
 var groupColumn = 33;
 $(document).ready(function () {
     var table = $('#projectTable').DataTable({
         columnDefs: [
             { visible: false, targets: [groupColumn] },
             { width: "7.2rem", targets: 4 },  // Set fixed width for column 0
             { width: "7.2rem", targets: 5 },  // Set fixed width for column 1
             { width: "7.2rem", targets: 6 }   // Set fixed width for column 2
         ],
         layout: {
             topStart: {
                 buttons: [
                     { extend: 'excelHtml5', className: 'excelButton' },
                     { extend: 'pageLength', className: 'pageButton' },
                     {
                         text: 'Show All',
                         action: function (e, dt, node, config) {
                             table.columns([12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29]).visible(true, true);
                         }
                     }
                 ]
             },
             topEnd: {
                 search: {
                     placeholder: 'Type to filter...',
                     text: '<span>Filter:</span> _INPUT_'
                 },
             },
             bottomEnd: {
                 paging: {
                     buttons: 3
                 }
             }
         },
         pageLength: 50,
        
         //responsive:true,
         responsive: {
             details: {
                 renderer: function (api, rowIdx, columns) {
                     let header1Cols = [12, 22];       // Quarters or year headers
                     let header2Cols = [32];           // Target/Forecast columns
                     let data = '';
                     columns.forEach((col) => {
                         let index = col.columnIndex;
                         let title = col.title;
                         // Identify header1Cols to add a separator before them
                         if (header1Cols.includes(index)) {
                             // Add separator line before the header
                             data += `
                         <tr>
                             <td colspan="2" style="border-top: 2px solid #ccc;"></td>
                         </tr>
                         <tr>
                             <td colspan="2" style="font-weight: bold;">${api.column(col.columnIndex).title(0)}</td>
                         </tr>`;
                         } else {
                             // Use the default title if it's not in header1Cols
                             if (header2Cols.includes(index)) {
                                 title = api.column(col.columnIndex).title(1);
                             }
                         }
                         // Append data rows
                         if (col.hidden) {
                             data += `
                         <tr data-dt-row="${col.rowIndex}" data-dt-column="${col.columnIndex}">
                             <td>${title}:</td>
                             <td>${col.data}</td>
                         </tr>`;
                         }
                     });
                     // Create table element
                     let table = document.createElement('table');
                     table.innerHTML = data;
                     return data ? table : false;
                 }
             }
         },
         "order": [[groupColumn, "asc"]],
         language: {
             paginate: { 'next': $('html').attr('dir') == 'rtl' ? 'Next &larr;' : 'Next &rarr;', 'previous': $('html').attr('dir') == 'rtl' ? '&rarr; Prev' : '&larr; Prev' }
         },
         "drawCallback": function (settings) {
             var api = this.api();
             var rows = api.rows({
                 page: 'current'
             }).nodes();
             var last = null;
             api.column(groupColumn, {
                 page: 'current'
             }).data().each(function (group, i) {
                 var rowData = api.row(api.row(rows).eq(i)).data();
                 if (last !== group) {
                     $(rows).eq(i).before(
                         '<tr class="group"><td colspan="100%" id="clmBusinessUnit" style="font-weight: bold;padding:4px!important;" class="row-group">' +
                         group +
                         '</td></tr>'
                     );
                     last = group;
                 }
             });
         }
     });
     table.columns([12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29]).visible(false, false);
     table.columns.adjust().draw(false); // adjust column sizing and redraw
 });
3 errors 8 warnings
Line 43: 'let' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 44: 'let' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 46: 'let' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 48: 'arrow function syntax (=>)' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 49: 'let' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 50: 'let' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 55: Unexpected '`'.
Line 56: Expected an identifier and instead saw '<'.
Line 56: Missing semicolon.
Line 57: Expected an identifier and instead saw '<'.
Line 57: Unrecoverable syntax error. (45% scanned).
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers