I need guidance according to this code, how to send the table drawn in the index by email?,how to make the information that comes from the form and is grouped in the table, can be sent by mail? This code that was published here is a good example.Since the need I have to learn is simplified with this code, there is a table with data entered from the inputs, but how can it be sent?
$(document).ready(function() {
//obtenemos el valor de los input
$('#adicionar').click(function() {
var nombre = document.getElementById("nombre").value;
var apellido = document.getElementById("apellido").value;
var cedula = document.getElementById("cedula").value;
var i = 1; //contador para asignar id al boton que borrara la fila
var fila = '<tr id="row' + i + '"><td>' + nombre + '</td><td>' + apellido + '</td><td>' + cedula + '</td><td><button type="button" name="remove" id="' + i + '" class="btn btn-danger btn_remove">Quitar</button></td></tr>'; //esto seria lo que contendria la fila
i++;
$('#mytable tr:first').after(fila);
$("#adicionados").text(""); //esta instruccion limpia el div adicioandos para que no se vayan acumulando
var nFilas = $("#mytable tr").length;
$("#adicionados").append(nFilas - 1);
//le resto 1 para no contar la fila del header
document.getElementById("apellido").value ="";
document.getElementById("cedula").value = "";
document.getElementById("nombre").value = "";
document.getElementById("nombre").focus();
});
$(document).on('click', '.btn_remove', function() {
var button_id = $(this).attr("id");
//cuando da click obtenemos el id del boton
$('#row' + button_id + '').remove(); //borra la fila
//limpia el para que vuelva a contar las filas de la tabla
$("#adicionados").text("");
var nFilas = $("#mytable tr").length;
$("#adicionados").append(nFilas - 1);
});
});
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<form>
<div class="form-group">
<p>
<label>Entre su Nombre:</label> <br>
<input id="nombre" class="form-control" type="text" placeholder="Nombre..."><br>
</p>
<p>
<label>Entre su Apellido:</label> <br>
<input id="apellido" class="form-control" type="text" placeholder="Apellido..."><br>
</p>
<p>
<label>Entre su Cédula:</label> <br>
<input id="cedula" class="form-control" type="text" placeholder="Cedúla"> <br>
</p>
<button id="adicionar" class="btn btn-success" type="button">Adicionar a la tabla</button>
</div>
</form>
<p>Elementos en la Tabla:
<div id="adicionados"></div>
</p>
<table id="mytable" class="table table-bordered table-hover ">
<tr>
<th>Nobmre</th>
<th>Apellidos</th>
<th>Cédula</th>
<th>Eliminar</th>`enter code here`
</tr>
</table>