# Table javascript p5.js

**URL:** https://discourse.processing.org/t/table-javascript-p5-js/18168
**Category:** Coding Questions
**Created:** [February 27, 2020, 2:09am UTC](https://discourse.processing.org/t/table-javascript-p5-js/18168 "2020-02-27T02:09:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ctrembla](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@ctrembla](https://discourse.processing.org/u/ctrembla)
#### Post date: [February 27, 2020, 2:09am UTC](https://discourse.processing.org/t/table-javascript-p5-js/18168/1 "2020-02-27T02:09:40Z")

</div>

Am I doing this correct? I read the tutoral on making Tables in p5.js, but when I try to make one it won’t run. ATM i’m trying to get a table to hold all the positions of the walls.

here main

```auto
var wall = [35];
var bs = 25;

function preload(){
  wallT = loadTable('wall.csv', 'csv');
}
function setup() {
  createCanvas(600, 600);
  for (var i = 0; i < 25; i++){
    wall[i] = new Wall(i);
  }
  wall[25] = new Wall(47);
  var tr = wallT.getnum(0,5); // here is where i try to get a number from the table
  print(tr);
}

function draw() {
  background(0);
  for (var i = wall.length - 1; i >= 0; i--){
    wall[i].show();
  }
}

```

here block

```auto
class Block{
  
  constructor(n) {
    this.x = n;
    this.y = 0;
    while (this.x > 23){
      this.y += 1;
      this.x -= 24;
    }
    this.y *= bs;
    this.x *= bs;
  } 
}

```

here wall

```auto
class Wall extends Block{
  
  constructor(n) {
    super(n);
  }
  
  show(){
    fill(255);
    rect(this.x,this.y,bs,bs);
  }
}

```

wall.csv

```auto
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,47

```

so am I trying to get the number in the table correctly or did I miss up?
