<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
    <script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
  </head>
  <body>
    <div class="container">
      <table id="example" class="display nowrap" width="100%">
        <thead>
          <tr>
            <th>Name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Age</th>
          </tr>
        </thead>
        <tfoot>
          <tr>
            <th>Name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Age</th>
          </tr>
        </tfoot>
<tbody>
        <tr id="af639976-8c05-4a39-bcd0-e4d043f27980" role="row" class="odd">                   
            <td class="g-hidden-xs-up sorting_1">2022-01-18T20:14:22+05:30</td>
            <td class="g-first-child">
                <div class="media align-items-center">
                    <div class="d-flex">
                        <div class="product-list-image-container g-width-40 g-height-40">
                            <img src="/assets/img-temp/v.png" alt="">
                        </div>
                    </div>
                    <div class="media-body text-left g-ml-15 g-py-15">
                        <a href="/dashboards/af639976-8c05-4a39-bcd0-e4d043f27980">testparam</a>
                    </div>
                </div>
            </td>
            <td id="transaction-amount">NA</td>                   
            <td id="last-transaction-time">NA</td>                 
        </tr>          
        <tr id="af639976-8c05-4a39-bcd0-e4d043f27981" role="row" class="odd">                   
            <td class="g-hidden-xs-up sorting_1">2022-01-18T20:14:22+05:30</td>
            <td class="g-first-child">
                <div class="media align-items-center">
                    <div class="d-flex">
                        <div class="product-list-image-container g-width-40 g-height-40">
                            <img src="/assets/img-temp/v.png" alt="">
                        </div>
                    </div>
                    <div class="media-body text-left g-ml-15 g-py-15">
                        <a href="/dashboards/af639976-8c05-4a39-bcd0-e4d043f27981">testparam1</a>
                    </div>
                </div>
            </td>
            <td id="transaction-amount">NA</td>                   
            <td id="last-transaction-time">NA</td>                 
        </tr>          
        </tbody>
      </table>
    </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;
}
 
$(document).ready( function () {
  var href_regex = /<a([^>]*?)href\s*=\s*(['"])([^\2]*?)\2\1*>/i
  var table = $('#example').DataTable({
    columnDefs: [
      {
        targets: 1,
        render: function (data, type, row) {
          if (type === 'filter') {            
            match = href_regex.exec( data )[3];
            if (match) {
              return href_regex.exec( data )[3];
            }
            return data;
          }
          return data;
        }
      }
    ]
  });
} );
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers