Array Data

Array Of Arrays

DataGridXL handles 2D arrays out-of-the-box. When using array of arrays, there are no column titles by default. You can use the columns setting to give titles to your unnamed data columns.

Read more in docs: Passing Options.

Code

<style>
#grid {
  height: 400px;
}
</style>

<div id="grid"></div>

<script src="https://code.datagridxl.com/datagridxl2.js"></script>
<script>
var data = [
  ["Chevrolet", "Suburban", 2010, "Yellow", "9/21/2019"],
  ["Chevrolet", "Cavalier", 2004, "Pink", "5/4/2020"],
  // ...
  ["Cadillac", "Seville", 2004, "Red", "4/21/2020"]
];

var grid = new DataGridXL("grid", {
  data: data,
  columns: [{
    title: "Brand",   
  }, {
    title: "Model"
  }, {
    title: "Year"
  }, {
    title: "Color"
  }, {
    title: "Order Date"
  }]
});
</script>

Leave email to receive latest updates!