<https://www.portugal-a-programar.pt/forums/topic/77340-datatable-com-loop-php-e-a%C3%A7%C3%A3o-jquery/>
<http://schema.org/text>
"Olá,\n \n\n\n\tEstou a usar dataTable dentro de um loop PHP, em cada linha tem uma ação com Jquery. Essa ação elimina a linha. O problema é que elimina a linha apenas nas 10 primeiras linhas, ou seja, nos registos da primeira página. O que estou eu a fazer mal? O Jquery está fora do loop PHP, está no rodapé.\n \n\n\n\t \n \n\n\n                &lt;table class=\"table table-bordered\" id=\"dataTable\" width=\"100%\" cellspacing=\"0\"&gt;\n              &lt;thead&gt;\n                &lt;tr&gt;\n                  &lt;th colspan=\"5\"&gt;Concluidos&lt;/th&gt;\n                &lt;/tr&gt;\n                &lt;tr&gt;\n                  &lt;th&gt;ID&lt;/th&gt;\n                  &lt;th&gt;Descrição&lt;/th&gt;\n                  &lt;th&gt;Local&lt;/th&gt;\n                  &lt;th&gt;Grau&lt;/th&gt;\n                  &lt;th&gt;&lt;i class=\"fas fa-fw fa-cog\"&gt;&lt;/i&gt;&lt;/th&gt;\n                &lt;/tr&gt;\n              &lt;/thead&gt;\n              &lt;tfoot&gt;\n                &lt;tr&gt;\n                  &lt;th&gt;ID&lt;/th&gt;\n                  &lt;th&gt;Descrição&lt;/th&gt;\n                  &lt;th&gt;Local&lt;/th&gt;\n                  &lt;th&gt;Grau&lt;/th&gt;\n                  &lt;th&gt;&lt;i class=\"fas fa-fw fa-cog\"&gt;&lt;/i&gt;&lt;/th&gt;\n                &lt;/tr&gt;\n              &lt;/tfoot&gt;\n              &lt;tbody&gt;\n              &lt;?PHP \n              $sql = \"SELECT id, descr, localiz, grau, estado, addpor, dataadd FROM trabalhos WHERE estado = 1\";\n              $result = $conn-&gt;query($sql);\n                if ($result-&gt;num_rows &gt; 0) {  \n                  while($row = $result-&gt;fetch_assoc()) {\n\n                    //Cor da urgencia de grau\n                    // 1 = urgente || 2 = Semi-urgente || 3 = Não Urgente\n\n                    $g = $row[\"grau\"];\n                    if ($g == \"1\"){\n                      $gclas = \"border-left-danger\";\n                    } else if ($g == \"2\"){\n                      $gclas = \"border-left-warning \";\n                    } else if ($g == \"3\"){\n                      $gclas = \"border-left-success \";\n                    }\n              ?&gt;                    \n                &lt;tr id=\"linha_&lt;?PHP echo $row[\"id\"]; ?&gt;\"&gt;\n                  &lt;td class=\"&lt;?PHP echo $gclas; ?&gt;\"&gt;&lt;?PHP echo $row[\"id\"]; ?&gt;&lt;/td&gt;\n                  &lt;td&gt;&lt;?PHP echo $row[\"descr\"]; ?&gt;&lt;/td&gt;\n                  &lt;td&gt;&lt;?PHP echo $row[\"localiz\"]; ?&gt;&lt;/td&gt;\n                  &lt;td&gt;&lt;?PHP echo $row[\"grau\"]; ?&gt;&lt;/td&gt;\n                  &lt;td&gt;\n                    &lt;a href=\"#\" class=\"btn btn-success btn-circle btn-sm foiFeito\" id=\"&lt;?PHP echo $row[\"id\"]; ?&gt;\" data-id=\"&lt;?PHP echo $row[\"id\"]; ?&gt;\"&gt;\n                      &lt;i class=\"fas fa-check\"&gt;&lt;/i&gt;\n                    &lt;/a&gt;                                            \n                  &lt;/td&gt;\n                &lt;/tr&gt;\n             &lt;?PHP\n                }\n              } else {\n                echo \"&lt;tr&gt;&lt;td&gt;Não há trabalhos por fazer&lt;/td&gt;&lt;/tr&gt;\";\n              }\n            $conn-&gt;close();\n            ?&gt;\n\n              &lt;/tbody&gt;\n            &lt;/table&gt;\n\n\n          //Trabalho efetuado\n        $(\".foiFeito\").click(function(){ \n          var idFeito=$(this).attr(\"data-id\")\n            $.ajax({\n                url:'../insertTrab.php?cmd=feito',\n                method:'POST',\n                data:{\n                    idFeito:idFeito\n                },\n               success:function(data){\n                $(\"#linha_\"+idFeito).css(\"background\", \"#f9e79f\");\n                $(\"#linha_\"+idFeito).fadeOut(1000);\n               }\n            });              \n        });\n\n\n\t \n "
<https://www.portugal-a-programar.pt/forums/topic/77340-datatable-com-loop-php-e-a%C3%A7%C3%A3o-jquery/>