tabela 1 é preenchida atravez de uma pesquisa no banco
<table class="table" id="disponiveis">
<?php if ($linhas2 == "") { ?>
<thead>
<tr>
<th>Nenhum Resultado Foi Encontrado Tente um outro Nome</th>
</tr>
</thead>
<?php } else { ?>
<thead>
<tr>
<th><i class="glyphicon glyphicon-ok"></i></th>
<th>#</th>
<th>Nome</th>
<th>Editora</th>
<th>Edicao</th>
<th>Local</th>
<th>Ano</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while($linhas2 = mysqli_fetch_array($resultado2))
{
echo "<tr>";
echo "<td> <input type='checkbox' name='adicionar'/>". "</td>";
echo "<td class='codigo'>".$linhas2['Codigo'] . "</td>";
echo "<td>".$linhas2['Nome'] . "</td>";
echo "<td>".$linhas2['Editora'] . "</td>";
echo "<td>".$linhas2['Edicao'] . "</td>";
echo "<td>".$linhas2['Local'] . "</td>";
echo "<td>".$linhas2['Ano'] . "</td>";
echo "<td> <button class='btn1'> OK </button></td>";
echo "</tr>";
?>
<?php }
}
mysqli_close($conn);
?>
</tbody>
tabela 2 recebe os valores selecionado apartir de um checkBox
</table>
</div>
<div class="col-md-6">
<h4 class="page-title">Livros Selecionados</h4>
<table class="table" id="selecionado">
<thead>
<tr>
<th><i class="glyphicon glyphicon-ok"></i></th>
<th>#</th>
<th>Autor</th>
<th>Editora</th>
<th>Edicao</th>
<th>Local</th>
<th>Ano</th>
<th>Acao</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
esse é o script que pega os valores da tabela 1 para tabela 2
<script type="text/javascript">
var adicionar = document.querySelectorAll("input[type='checkbox']");
var selecionado = document.querySelector("#selecionado tbody");
var disponiveis = document.querySelector("#disponiveis tbody");
var adicionarOnClick = function () {
var escopo = this.checked ? selecionado : disponiveis;
escopo.appendChild(this.parentNode.parentNode);
};
for (var indice in adicionar) {
adicionar[indice].onclick = adicionarOnClick;
}
</script>