Add the following code to your table so you have a source of disoaro to pick up your current line (the one that is clicked).
<td>
<button type="button"
onclick="pegarEssaLinha(this)">
Pegue esta Linha
</button>
</td>
Now in Javascript put this function, because it will be triggered at the click of the table.
function pegarEssaLinha(elemento) {
// Linha atual
var linhaAtual = $(elemento).closest("tr");
// Celulas
var coluna0 = linhaAtual.find("td:eq(0)").text().trim();
window.alert(colunaID);
}
Note that the section where you have >>> td:eq(0) <<< is the part that takes the value of the first column of the TD of the Line where the button was triggered. To take the other values change 0 by the desired column number.
I particularly never used these Curl functions, so if I were to send to register Mandaria via Ajax.
function pegarEssaLinha(elemento) {
// Linha atual
var linhaAtual = $(elemento).closest("tr");
// Celulas
var nParametros = {};
nParametros.coluna0 = linhaAtual.find("td:eq(0)").text().trim();
nParametros.coluna1 = linhaAtual.find("td:eq(1)").text().trim();
nParametros.coluna2 = linhaAtual.find("td:eq(2)").text().trim();
nParametros.coluna3 = linhaAtual.find("td:eq(3)").text().trim();
nParametros.coluna4 = linhaAtual.find("td:eq(4)").text().trim();
nParametros.coluna5 = linhaAtual.find("td:eq(5)").text().trim();
nParametros.coluna6 = linhaAtual.find("td:eq(6)").text().trim();
nParametros.coluna7 = linhaAtual.find("td:eq(7)").text().trim();
nParametros.coluna8 = linhaAtual.find("td:eq(8)").text().trim();
nParametros.coluna9 = linhaAtual.find("td:eq(9)").text().trim();
nParametros.coluna10 = linhaAtual.find("td:eq(10)").text().trim();
nParametros.coluna11 = linhaAtual.find("td:eq(11)").text().trim();
nParametros.coluna12 = linhaAtual.find("td:eq(12)").text().trim();
// Envia os dados para o servidor.
$.post("url_onde_pego_os_dados", nParametros, function (resposta) {
window.alert(resposta);
});
}
Take this data by retrieving the super global $_POST["coluna0"] and so for a day one by one there on the server.
Since I don’t know what you need to do, I’m gonna stop here and not make it too complicated.
Welcome to Stackoverflow. What have you tried so far? Tried some parser for XML/HTML? Please note not to use regular expressions for HTML
– Ismael Miguel
Utilize
xpath
: Example 1 and Example 2– Valdeir Psr