Cargar el script de la aplicación de la tabla de datos
<script type='text/javascript'>
$(document).ready(function(){
var runner = google.script.run.withFailureHandler(onFailure);
runner.withSuccessHandler(onSuccess).getData();
});
var onSuccess = function(data){
var aDataSet = data.slice(1); // all except header
var head = []; // headers
data[0].forEach(function(e){
head.push({'sTitle': e});
});
$('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>' );
$('#example').dataTable( {
"aaData": aDataSet,
"aoColumns": head
});
}
var onFailure = function(err){
alert(err.message);
}
</script>
Angry Anteater