Dynamic Array Table (versatile display methods)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © kaigouthro
//@version=5

// @description Dynamic Array Table.... Configurable Shape/Size Table from Arrays
// Allows for any data in any size combination of arrays to join together
// with: 
// - all possible orientations!
// - filling all cells contiguously and/orflipping at boundaries
// - vertical or horizontal rotation
// - x/y axis direction swapping
// - all types array inputs for data.
// please notify of any bugs. thanks
library("datTable")

import kaigouthro/hsvColor/11 as h 
import kaigouthro/into/2
import kaigouthro/font/4
import kaigouthro/calc/5

export type crd
    int  x         = 0 
    int  y         = 0
    bool dirx      = false
    bool diry      = false

export type tablesetting
    bool   contiguous   = false
    bool   vertical     = false
    bool   reverse_y    = false
    bool   reverse_x    = false
    bool   live         = true
    int    textsize     = 1
    int    truncate     = 10
    int    count        = 10
    int    font         = 1
    float  cell_sizeX   = 1
    float  cell_sizeY   = 1
    bool   flip         = true
    int    gap          = 0
    int    border       = 0
    color  bg           = #00000000
    color  bordercol    = #00000000
    color  framecol     = #00000000
    int    bordersize   = 0
    int    framesize    = 0
    int    largest      = 0

export type arraytable 
    table tbl
    tablesetting setting
    crd   coords 

export type cellsize 
    float  []  width  
    float  []  height 
    
    bool merge = false
    int  max   = na

export type array_s
    string []  strings
    string []  datas
    color  []  colors
    cellsize cells
export type array_f
    string []  strings
    float  []  datas
    color  []  colors
    cellsize cells
export type array_b
    string []  strings
    bool   []  datas
    color  []  colors
    cellsize cells
export type array_i
    string []  strings
    int    []  datas
    color  []  colors
    cellsize cells


//@funcction helper
_init  (_posit , _gap) =>
    var  displaytable  = table.new(_posit, 100, 100, na, na,na, na, _gap)

// @function Get Table (otional gapping cells)
// @param   _posit String or Int (1-9 3x3 grid L to R) 
// @returns Table
export init  (int _posit, int _gap = 0 ) =>
    _pos = switch _posit
        1 => 'top_left'
        2 => 'top_center'
        3 => 'top_right'
        4 => 'middle_left' 
        5 => 'middle_center' 
        6 => 'middle_right' 
        7 => 'bottom_left'
        8 => 'bottom_center'
        9 => 'bottom_right'
    _init(_pos,_gap)

// @function Get Table (otional gapping cells)
export init  (string _posit,  int _gap = 0 ) =>
    _init(_posit,_gap)

// @function Req'd coords Seperate for VARIP table, non-varip coords
export coords()=> crd.new(0,0,false,false)        

// helpers for matching arrray that is shorrt.
resize(x,sz)=>
    while array.size(x) < sz
        array.push(x,na)
            
_largest(a,b,c) => 
    varip size  = int(na)
    _sizea      = array.size(a)
    _sizeb      = array.size(b)
    _sizec      = array.size(c)
    held        = math.max(_sizea,_sizeb,_sizec)
    size        := nz(size,held)
    if size !=  held
        resize(a,size)
        resize(b,size)
        resize(c,size)
        size := held[1]

 // Demo teplate ^^^^^^^^^^^^^^^^^^
///////////////////////////////////////////

show (arraytable displaytable, arr)=>
    tableconfig  = tablesetting.copy(displaytable.setting)
    tableconfig := displaytable.setting
    coord        = displaytable.coords
    varip contig      = tableconfig.contiguous   , contig      := tableconfig.contiguous
    varip vertical    = tableconfig.vertical     , vertical    := tableconfig.vertical
    varip reverse_y   = tableconfig.reverse_y    , reverse_y   := tableconfig.reverse_y
    varip reverse_x   = tableconfig.reverse_x    , reverse_x   := tableconfig.reverse_x
    varip live        = tableconfig.live         , live        := tableconfig.live
    varip truncate    = tableconfig.truncate     , truncate    := tableconfig.truncate
    varip textsize    = tableconfig.textsize     , textsize    := tableconfig.textsize
    varip font        = tableconfig.font         , font        := tableconfig.font
    varip cell_sizeX  = tableconfig.cell_sizeX   , cell_sizeX  := tableconfig.cell_sizeX
    varip cell_sizeY  = tableconfig.cell_sizeY   , cell_sizeY  := tableconfig.cell_sizeY
    varip flip        = tableconfig.flip         , flip        := tableconfig.flip
    _textsize = switch textsize
        0 => size.auto 
        1 => size.tiny  
        2 => size.small
        3 => size.normal
        4 => size.large
        5 => size.huge
        =>   size.auto
    var int  _x =  na,  var int  _y = na
    _mergable   = (arr.cells.merge == true)
    _texts      =  arr.strings
    _cols       =  arr.colors
    _minsize    =  truncate
    _sizeofarr  =  array.size(_texts)
    if not vertical and bar_index + 5 >= last_bar_index
        truncate    := math.min (_sizeofarr,_minsize)
    if (live and bar_index + 2 >= last_bar_index) or barstate.islastconfirmedhistory
        _x          := contig ? coord.x :  vertical ?     coord.x  +1 : 0 
        _y          := contig ? coord.y :  vertical ? 0 : coord.y  +1
        _depth      =  _sizeofarr   -1
        _xMax       =  math.max    ( 0  , ( not contig ? 0 : - 1 ) + (not vertical ? truncate    : math.ceil( _depth/truncate ) ) )
        _yMax       =  math.max    ( 0  , ( not contig ? 0 : - 1 ) + (not vertical ? math.ceil( _depth/truncate )  : truncate     ) )
        _yis        =  0, _xis          =   0
        _dirx       =  coord.dirx
        _diry       =  coord.diry
        _vsize      =  cell_sizeY != 0. ? cell_sizeY : 0.
        _hsize      =  cell_sizeX != 0. ? cell_sizeX : 0.
        _step       =  _mergable ? math.ceil( truncate / _sizeofarr) : 1
        for _n      =  0 to math.ceil(_mergable ? truncate : math.min(truncate/_sizeofarr*truncate, _sizeofarr/truncate*_sizeofarr)) - 1
            i       =  _n
            if _mergable
                i  := int ( _n * _sizeofarr / truncate )
            _string = array.get (_texts,i)
            _string += not (_string == '') ? '\n' : ''
            switch 
                flip      =>
                    _xis  :=  _dirx  ? _xMax -  _x : _x                                     
                    _yis  :=  _diry  ? _yMax -  _y : _y  
                =>
                    _xis  := _x , _yis := _y            
            if _mergable and _yis  % _step  == 0
                switch 
                    vertical     =>
                        table.merge_cells ( displaytable.tbl                ,     
                              reverse_x  ? 99 - _xis  :  _xis               ,   
                              reverse_y  ? 99 - _yis  -  _step + 1  : _yis  , 
                              reverse_x  ? 99 - _xis  :  _xis               , 
                              reverse_y  ? 99 - _yis  :  _step - 1  + _yis  ) 
                    =>
                        table.merge_cells ( displaytable.tbl                ,
                              reverse_x  ? 99 - _xis  -  _step + 1  : _xis  ,
                              reverse_y  ? 99 - _yis  :  _yis               ,
                              reverse_x  ? 99 - _xis  :  _step - 1  + _xis  ,
                              reverse_y  ? 99 - _yis  :  _yis               )
                                
            _bgcolor       = array.get   ( _cols     , i )                   
            _textcol       = h.bright    ( _bgcolor      ) > 0.6 ? #000000 : #ffffff
            _data          = array.get   ( arr.datas , i )
            _datastr       = into.s ( _data  )
            _stringtext    = _string + (na ( _data) or _datastr == 'NaN' or _datastr == '' ? '' :  _datastr )
            _text          = font.uni    ( _stringtext   , font         ) 
            _hsize        := nz(array.get(arr.cells.width  , i ) , _hsize )
            _vsize        := nz(array.get(arr.cells.height , i ) , _vsize )
            table.cell(   displaytable.tbl  , reverse_x  ? 99 - _xis : _xis , reverse_y ? 99 - _yis : _yis , 
                          _text , _hsize    , _vsize,
                          _textcol          , text.align_center , text.align_center , 
                          _textsize         , _bgcolor )
            switch vertical
                false =>
                    if  _x    >= _xMax
                        _y    += 1
                        _x    := 0
                        _dirx := _dirx?false:true
                    else
                        _x    += 1                
                =>
                    if  _y    >= _yMax
                        _x    += 1
                        _y    := 0
                        _diry := _diry?false:true
                    else
                        _y +=  1
       
        coord.x     := _x
        coord.y     := _y
        coord.dirx  := _dirx
        coord.diry  := _diry
    
    if barstate.isconfirmed
        table.set_bgcolor      (displaytable.tbl,tableconfig.bg          )
        table.set_border_color (displaytable.tbl,tableconfig.bordercol   )
        table.set_border_width (displaytable.tbl,tableconfig.bordersize  )
        table.set_frame_color  (displaytable.tbl,tableconfig.framecol    )
        table.set_frame_width  (displaytable.tbl,tableconfig.framesize   )

    displaytable.tbl

//@function Array joiner to DAT table
//@param displaytable (arraytable) Object table with settings and coords (refresh coords each calc) 
//@param _stringsin   (string[])   (OPTIONAL)   array of text titles/names for cells             
//@param _colsin      (color[])    (OPTIONAL)   array of background colors for cells     
//@param _datas       (int/float/bool/string[]) array of data (int/bool/floats)             
//@param _cellsizes   (cellsize)   (OPTIONAL)   object with specific cell sizes/merge option

export add(arraytable displaytable,  string[] _stringsin, color[] _colsin, string[] _datas   , cellsize _cellsizes      ) =>
    _largest(_stringsin,_colsin,_datas)
    arr = array_s.new( _stringsin, _datas, _colsin,_cellsizes)
    show ( displaytable, arr)
    
export add(arraytable displaytable,  string[]  _stringsin, color[] _colsin, bool[]  _datas    , cellsize _cellsizes      ) =>
    _largest(_stringsin,_colsin,_datas)
    arr = array_b.new( _stringsin, _datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  string[]  _stringsin, color[] _colsin, float[] _datas    , cellsize _cellsizes      ) =>
    _largest(_stringsin,_colsin,_datas)
    arr = array_f.new( _stringsin, _datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  string[]  _stringsin, color[] _colsin, int   [] _datas   , cellsize _cellsizes      ) =>
    _largest(_stringsin,_colsin,_datas)
    arr = array_i.new( _stringsin, _datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  string[] _stringsin, color[] _colsin, string[] _datas         ) =>
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_s.new( _stringsin, _datas, _colsin,_cellsizes)
    show ( displaytable, arr)
    
export add(arraytable displaytable,  string[]  _stringsin, color[] _colsin, bool[]  _datas          ) =>
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_b.new( _stringsin, _datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  string[]  _stringsin, color[] _colsin, float[] _datas          ) =>
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_f.new( _stringsin, _datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  string[]  _stringsin, color[] _colsin, int   [] _datas         ) =>
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_i.new( _stringsin, _datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  string[]  _datas, color[] _colsin                              ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_s.new(_stringsin, _datas   ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  float[]  _datas, color[] _colsin                               ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_f.new(_stringsin, _datas   ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  bool[]  _datas, color[] _colsin                                ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_b.new(_stringsin, _datas   ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  int []  _datas, color[] _colsin                                ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_f.new(_stringsin, _datas   ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  string[]  _datas                                               ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    var _colsin        = array.new<color>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_s.new(_stringsin,_datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  float[]  _datas                                                ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    var _colsin        = array.new<color>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_f.new(_stringsin,_datas  ,_colsin,_cellsizes)
    show ( displaytable, arr)

export add(arraytable displaytable,  bool[]  _datas                                                 ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    var _colsin        = array.new<color>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_b.new(_stringsin,_datas  ,_colsin,_cellsizes)
    show (displaytable, arr)

export add(arraytable displaytable,  int[]  _datas                                                 ) =>
    varip _stringsin   = array.new<string>(array.size(_datas))
    var _colsin        = array.new<color>(array.size(_datas))
    _largest(_stringsin,_colsin,_datas)
    var _cellsizes = cellsize.new(array.new_float(1000,na),array.new_float(1000,na))
    arr = array_f.new(_stringsin,_datas  ,_colsin,_cellsizes)
    show (displaytable, arr)


//////////////////////////////////////////////////////
// copy paste this to configure
//////////////////////////////////////////////////////

_o ='   ██████  ██████  ███    ██ ███████ ██  ██████  '
_o:='  ██      ██    ██ ████   ██ ██      ██ ██       '
_o:='  ██      ██    ██ ██ ██  ██ █████   ██ ██   ███ '
_o:='  ██      ██    ██ ██  ██ ██ ██      ██ ██    ██ '
_o:='   ██████  ██████  ██   ████ ██      ██  ██████  '

//  ==========   input constants  ============  {
varip _CONTIGUOUS  = 'Contiguous, Join Arrays'
varip _VERTICAL    = 'Rotate 90 deg.'   
varip _REVY        = 'Flip Y axis'       
varip _REVX        = 'Flip X axis'       
varip _LIVE        = 'Realtime? (or last hist)'      
varip _TEXTSIZE    = 'Text Size (0 = auto)'   
varip _TRUNCATE    = 'Size Limit (break/flip if longer)'   
varip _FONT        = 'Font Substitute (see \'font\' Lib'      
varip _CELLSIZEV   = 'CellSize ↕ '
varip _CELLSIZEH   = 'CellSize ↔ '
varip _FLIP        = 'Flip at bounds'
varip _COUNT       = 'Columns'
varip _BG          = 'Background Color'
varip _BORDERCOL   = 'Border Color'
varip _BORDERSIZE  = 'Border Size'
varip _FRAMESIZE   = 'Frame Size'
varip _FRAMECOL    = 'Frame Color'

// group names for inputs
varip  _settings   = 'DAT Table Settings'
varip  _toggles    = 'Toggles'

// table position
string  tableYpos  = input.string  ('bottom'  , '↕'               , inline  =  '01', group = _settings   , options=['top', 'middle', 'bottom'])
string  tableXpos  = input.string  ('right'   , '↔'               , inline  =  '01', group = _settings   , options=['left', 'center', 'right'], tooltip='Position on the chart.')
varip  _pos        = (tableYpos + '_' + tableXpos)

// table var.. COORDS currently must not be var.
var displaytable  = init (_pos)
var config = tablesetting.new()

config.bg         := input.color ( #00000000       ,    _BG         ,                        inline = 'col'          ,  group  = _settings  +  'Adjutments')
config.bordercol  := input.color ( #00000000       ,    _BORDERCOL  ,                        inline = 'col'          ,  group  = _settings  +  'Adjutments')
config.framecol   := input.color ( #00000000       ,    _FRAMECOL   ,                        inline = 'col'          ,  group  = _settings  +  'Adjutments')
config.bordersize := input.int   (  1              ,    _BORDERSIZE , 0      ,   5           , inline = 'frame'        ,  group  = _settings  +  'Adjutments')
config.cell_sizeX := input.float (  1              ,    _CELLSIZEH  , 0      ,   5 ,step=0.25, inline = 'adj'          ,  group  = _settings  +  'Adjutments')
config.cell_sizeY := input.float (  1              ,    _CELLSIZEV  , 0      ,   5 ,step=0.25, inline = 'adj'          ,  group  = _settings  +  'Adjutments')
config.contiguous := input.bool  (  false          ,    _CONTIGUOUS ,                          inline = 'modes'        ,  group  = _toggles   ) 
config.count      := input.int   (  5              ,    _COUNT      , 5      ,   100         , inline = 'adj'          ,  group  = _settings  +  'Adjutments')
config.flip       := input.bool  (  true           ,    _FLIP       ,                          inline = 'modes'        ,  group  = _toggles   ) 
config.font       := input.int   (  1              ,    _FONT       , 1      ,   16          , inline = 'adj'          ,  group  = _settings  +  'Adjutments')
config.live       := input.bool  (  true           ,    _LIVE       ,                          inline = 'modes'        ,  group  = _toggles   ) 
config.reverse_x  := input.bool  (  true           ,    _REVX       ,                          inline = 'orientation'  ,  group  = _toggles   ) 
config.framesize  := input.int   (  1              ,    _FRAMESIZE  , 0      ,   5           , inline = 'frame'        ,  group  = _settings  +  'Adjutments')
config.reverse_y  := input.bool  (  true           ,    _REVY       ,                          inline = 'orientation'  ,  group  = _toggles   ) 
config.textsize   := input.int   (  1              ,    _TEXTSIZE   , 0      ,   5           , inline = 'adj'          ,  group  = _settings  +  'Adjutments')
config.truncate   := input.int   (  10             ,    _TRUNCATE   , 2      ,   100         , inline = 'adj'          ,  group  = _settings  +  'Adjutments')
config.vertical   := input.bool  (  true           ,    _VERTICAL   ,                          inline = 'orientation'  ,  group  = _toggles   ) 


// // set up table object
var arraytable tab = arraytable.new(init(_pos,input(1)),config,coords())




_l1 = input(5) 
_l2 = input(5) 
_l3 = input(5) 


// craete some arrays and plug them in..
if bar_index + 2 >= last_bar_index
    tab.coords := coords()

    for i = 1 to 1
        str  = array.new<string>  (_l1 , '')//into.s(i)) 
        // for [n,val] in str 
        //     array.set(str ,n, into.s(n) )
        col  = array.new<color>   (_l1 , color(na)) 
        for [n,val] in col 
            array.set(col ,n, #ffe564)
        dat = array.new<string>    (_l1 , '')
        // for [n,val] in dat 
            // array.set(dat ,n, str.tostring(n))//str.format('close[{0}] by {1,number,#.##} %',n+1, (close[i]/close[n+1]-1)*100))


        _x = array.new_float(100,na)
        _y = array.new_float(100,na)
        add ( tab,str,col,dat,cellsize.new(_x,_y,true,_l3))

    for i = 1 to 1
        
        str  = array.new<string>  (_l2 , '')//into.s(i)) 
        // for [n,val] in str 
        //     array.set(str ,n, into.s(n) )
        col  = array.new<color>   (_l2 , color(na)) 
        for [n,val] in col 
            array.set(col ,n, #67ffcf)
        dat = array.new<string>    (_l2 , '')
        // for [n,val] in dat 
            // array.set(dat ,n, str.tostring(n))//str.format('close[{0}] by {1,number,#.##} %',n+1, (close[i]/close[n+1]-1)*100))

        _x = array.new_float(100,na)
        _y = array.new_float(100,na)
        add ( tab,str,col,dat,cellsize.new(_x,_y,true,_l3))

    for i = 1 to 2
        
        str  = array.new<string>  (_l2*2 , '')//into.s(i)) 
        // for [n,val] in str 
        //     array.set(str ,n, into.s(n) )
        col  = array.new<color>   (_l2*2 , color(na)) 
        for [n,val] in col 
            array.set(col ,n, #9c4aff)
        dat = array.new<string>    (_l2*2 , '')
        // for [n,val] in dat 
            // array.set(dat ,n, str.tostring(n))//str.format('close[{0}] by {1,number,#.##} %',n+1, (close[i]/close[n+1]-1)*100))

        _x = array.new_float(100,na)
        _y = array.new_float(100,na)
        add ( tab,str,col,dat,cellsize.new(_x,_y,true,_l3))


// // craete some arrays and plug them in..
// if bar_index + 2 >= last_bar_index
//     tab.coords := coords()
//     for i = 1 to 3
//         str  = array.new<string>  (6, into.s(i)) 
//         for [n,val] in str 
//             array.set(str ,n, 'close[' + into.s(i) +
//              '] is ' + (close[i] > close[n+1] ? 'above' : 'below'))
//         col  = array.new<color>   (6, color(na)) 
//         for [n,val] in col 
//             array.set(col ,n, h.hsv((close[i]/close[n+1]-1)*12000 + 60,1,1,1) )
//         dat = array.new<string>    (6, '')
//         for [n,val] in dat 
//             array.set(dat ,n, str.format('close[{0}] by {1,number,#.##} %',n+1, (close[i]/close[n+1]-1)*100))
//         array.unshift(str,'Changes for')
//         array.unshift(col,#ffffff        )
//         array.unshift(dat,'close[' + into.s(i)+']')

//         _x = array.new_float(100,na)
//         _y = array.new_float(100,na)
//         add ( tab,str,col,dat,cellsize.new(_x,_y,false,config.truncate))

// // craete merged 
// if bar_index + 2 >= last_bar_index
//     tab.coords := coords()
//     for i = 1 to 3
//         str  = array.new<string>  (6, into.s(i)) 
//         for [n,val] in str 
//             array.set(str ,n, 'close[' + into.s(i) +
//              '] is ' + (close[i] > close[n+1] ? 'above' : 'below'))
//         col  = array.new<color>   (6, color(na)) 
//         for [n,val] in col 
//             array.set(col ,n, h.hsv((close[i]/close[n+1]-1)*12000 + 60,1,1,1) )
//         dat = array.new<string>    (6, '')
//         for [n,val] in dat 
//             array.set(dat ,n, str.format('close[{0}] by {1,number,#.##} %',n+1, (close[i]/close[n+1]-1)*100))
//         array.unshift(str,'Changes for')
//         array.unshift(col,#ffffff        )
//         array.unshift(dat,'close[' + into.s(i)+']')

//         _x = array.new_float(100,na)
//         _y = array.new_float(100,na)
//         add ( tab,str,col,dat,cellsize.new(_x,_y,true,config.truncate))

