Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-git.js"></script>
<table border="2"><!-- Iniciando a Tabela -->
        <thead>
            <tr><!-- Início dos Títulos da Tabela / Cabeçalho -->
                <th>Tipo</th>
                <th>Descrição</th>                                                                                                              
            </tr><!-- Fim dos Títulos da Tabela / Cabeçalho -->
        </thead>
        <tbody>
        </tbody>
    </table>
</body>
</html>
 
var json = [{"codigo_produto":"AB","codigo_tipo":"1","descricao":"1"},
{"codigo_produto":"AB","codigo_tipo":"2","descricao":"2"},
{"codigo_produto":"AB","codigo_tipo":"3","descricao":"3"},
{"codigo_produto":"AB","codigo_tipo":"4","descricao":"4"},
{"codigo_produto":"AB","codigo_tipo":"5","descricao":"5"}];
var html = "";
for (var i = 0; i < json.length; i++) {
  html += '<tr>';
    html += '<td><input type="hidden" name="id[]" value="'+json[i].codigo_produto+'"></td>';
    html += '<td><input type="text" name="codigo_tipo[]" value="'+json[i].codigo_tipo+'" /></td>';
    html += '<td><input type="text" name="descricao[]" value="'+json[i].descricao+'" /></td>';
  html += '</tr>';
}
$("table tbody").append(html);
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers