Clonar Determinadas colunas Tabela

Clonar Determinadas colunas Table

by Rapha Souza

HTML

<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<table id="myTable" class="table table-condensed table-hover"><thead><tr><th onclick="ordenarTable()" class="sortStyle">Nº Solicitação</th><th onclick="ordenarTable()" class="sortStyle">Estab.</th><th onclick="ordenarTable()" class="sortStyle">Cod. Fav.</th><th onclick="ordenarTable()" class="sortStyle">Nome Favorecido</th><th>Vencimento</th><th onclick="ordenarTable()" class="sortStyle">Forma de Pagamento</th><th onclick="ordenarTable()" class="sortStyle">Banco</th><th onclick="ordenarTable()" class="sortStyle">Agência</th><th onclick="ordenarTable()" class="sortStyle">Conta</th><th>Valor Líquido</th><th>Ações</th></tr><tr class="filters" style=""><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable" placeholder="Buscar" onclick="filtrar()"></th><th><input type="text" class="form-control buscarTable"...

JavaScript

var $target = $("#targetT");

$("#myTable tr").each(function() {
    var $tds = $(this).children(),
        $row = $("<tr></tr>");
  $row.append($tds.eq(0).clone()).appendTo($target)
   $row.append($tds.eq(1).clone()).appendTo($target)
   
   
  
});