- assert (x >= 0 && x < table->n[TABLE_HORZ] + (axis == TABLE_HORZ));
- assert (y >= 0 && y < table->n[TABLE_VERT] + (axis == TABLE_VERT));
- return table->klass->get_rule (table, axis, x, y);
+ struct table *t;
+
+ t = pool_create_container (struct table, container);
+ t->n[TABLE_HORZ] = nc;
+ t->n[TABLE_VERT] = nr;
+ t->h[TABLE_HORZ][0] = hl;
+ t->h[TABLE_HORZ][1] = hr;
+ t->h[TABLE_VERT][0] = ht;
+ t->h[TABLE_VERT][1] = hb;
+ t->ref_cnt = 1;
+
+ t->cc = pool_calloc (t->container, nr * nc, sizeof *t->cc);
+ t->ct = pool_calloc (t->container, nr * nc, sizeof *t->ct);
+
+ t->rh = pool_nmalloc (t->container, nc, nr + 1);
+ memset (t->rh, TABLE_STROKE_NONE, nc * (nr + 1));
+
+ t->rv = pool_nmalloc (t->container, nr, nc + 1);
+ memset (t->rv, TABLE_STROKE_NONE, nr * (nc + 1));
+
+ memset (t->styles, 0, sizeof t->styles);
+ memset (t->rule_colors, 0, sizeof t->rule_colors);
+
+ return t;