/*
Builds the header row of a table

@param {string} dataType
@param {string} data
@param {Boolean} expand
@returns {string}
198874
function doRowHeader(dataType, data, expand){
	return format(ROWHEADER, dataType, doHeaderStyle(dataType, expand), data);
}
1326313
function columnWordDataToImgDataFormatAsWords(columns, h, w) {
    const imgDataWordsLength = w * h;

    let convertedArr = new Array(imgDataWordsLength);
    for (var i = 0; i < imgDataWordsLength; i++) {
        const {column, depth} = serialToColumnMap(i, h, w);
        convertedArr[i] = columns[column][depth];
    }
    return convertedArr;
}
1208773
function buildNav(data) {
  // var doclets = data().get();
  // var graftNodes = {};
  // graft(graftNodes, doclets);
  // fs.writeFileSync(path.resolve(outdir, 'dump-graft.json'), dumper.dump(graftNodes), 'utf8');
  // fs.writeFileSync(path.resolve(outdir, 'dump-jsdoc3-members.json'), dumper.dump(members), 'utf8');
  // fs.writeFileSync(path.resolve(outdir, 'dump-doclets.json'), dumper.dump(doclets), 'utf8');

  var seen = {};
  var exclude = (env.conf.exclude || []).map(function(e) {
    return typeof e === "string" ? { longname: e } : e;
  });

  var memberGroups = data({
      'memberof': {
        isString: true
      }
    })
    .get()
    .filter(createExclude(exclude))
    .reduce(function (container, item) {
      var groupName = item.memberof;

      if (!container.hasOwnProperty(groupName)) {
        container[groupName] = [];
      }
      container[groupName].push(item);
      return container;
    }, {});

  var globalGroup = data({
      'scope': 'global'
    })
    .get()
    .filter(createExclude(exclude))
    .filter(function (item) {
      return !memberGroups.hasOwnProperty(item.longname);
    });

  // fs.writeFileSync(path.resolve(outdir, 'dump-memberof.json'), dumper.dump(memberGroups), 'utf8');
  // fs.writeFileSync(path.resolve(outdir, 'dump-global.json'), dumper.dump(globalGroup), 'utf8');

  var nav = ''; //'<h2><a href="index.html">Home</a></h2>';
  nav += buildMemberNav(globalGroup, 'global', seen, linkto);

  return Object.keys(memberGroups).reduce(function (html, groupName) {
    html += buildMemberNav(memberGroups[groupName], groupName, seen, linkto);
    return html;
  }, nav);
}
138946
function buildTable(tbody, data) {
  tbody.empty();
  data.forEach(function(item) {
    var row = $('<tr>').appendTo(tbody);
    $('<td>').appendTo(row).text(item.price);
    $('<td>').appendTo(row).text(item.weight);
    $('<td>').appendTo(row).text(item.taste);

    // Associate underlying data with row node so we can access it later
    // for filtering.
    row.data('item', item);
  });
}
804324
private function addHTMLTable($headers, $data, $options = [])
    {
        $w = (isset($options['width']) and is_array($options['width'])) ? $options['width'] : null;
        $a = (isset($options['align']) and is_array($options['align'])) ? $options['align'] : [];
        $buffer = '<table style="border:1px solid #333">';
        // Definir títulos de columnas
        $thead = isset($options['width']) and is_array($options['width']) and count($options['width']) == count($headers);
        if ($thead)
            $buffer .= '<thead>';
        $buffer .= '<tr>';
        $i = 0;
        foreach ($headers as &$col) {
            $width = ($w and isset($w[$i])) ? (';width:'.$w[$i].'mm') : '';
            $align = isset($a[$i]) ? $a[$i] : 'center';
            $buffer .= '<th style="border-right:1px solid #333;border-bottom:1px solid #333;text-align:'.$align.$width.'"><strong>'.strip_tags($col).'</strong></th>';
            $i++;
        }
        $buffer .= '</tr>';
        if ($thead)
            $buffer .= '</thead>';
        // Definir datos de la tabla
        if ($thead)
            $buffer .= '<tbody>';
        foreach ($data as &$row) {
            $buffer .= '<tr>';
            $i = 0;
            foreach ($row as &$col) {
                $width = ($w and isset($w[$i])) ? (';width:'.$w[$i].'mm') : '';
                $align = isset($a[$i]) ? $a[$i] : 'center';
                $buffer .= '<td style="border-right:1px solid #333;text-align:'.$align.$width.'">'.$col.'</td>';
                $i++;
            }
            $buffer .= '</tr>';
        }
        if ($thead)
            $buffer .= '</tbody>';
        // Finalizar tabla
        $buffer .= '</table>';
        // generar tabla en HTML
        $this->writeHTML($buffer, true, false, false, false, '');
    }
1356822
function __expand(bytes) {

        // Resize buffer if more space needed
        if (length+bytes >= buffer.length) {
            var new_buffer = new Uint8Array((length+bytes)*2);
            new_buffer.set(buffer);
            buffer = new_buffer;
        }

        length += bytes;

    }
1065255
function (data) {
    var schema = this.schema;
    if (typeof data === 'string') { return data; }
    if (this.isSingleProperty) { return stringifyProperty(data, schema); }
    data = stringifyProperties(data, schema);
    return styleParser.stringify(data);
  }
295507
function insertRow(
    opts: Options,
    change: Change,
    at?: number, // row index
    getRow?: (columns: number) => Block // Generate the row yourself
) {
    const { value } = change;
    const { startKey } = value;

    const pos = TablePosition.create(opts, value.document, startKey);
    const { table } = pos;

    // Create a new row with the right count of cells
    const columns = table.nodes.get(0).nodes.size;
    const newRow = getRow ? getRow(columns) : createRow(opts, columns);

    if (typeof at === 'undefined') {
        at = pos.getRowIndex() + 1;
    }

    return change
        .insertNodeByKey(table.key, at, newRow)
        .collapseToEndOf(newRow.nodes.get(pos.getColumnIndex()));
}
290431
public static void feedTableDataFromHeader(DbaseFileHeader header, CreateTableData data) throws IOException {
        for (int i = 0; i < header.getNumFields(); i++) {
            String fieldsName = header.getFieldName(i);
            final int type = dbfTypeToH2Type(header,i);
            Column column = new Column(fieldsName.toUpperCase(), type);
            column.setPrecision(header.getFieldLength(i)); // set string length
            data.columns.add(column);
        }
    }
566088
function getExpandoData(ownerDocument) {
    var data = expandoData[ownerDocument[expando]];
    if (!data) {
        data = {};
        expanID++;
        ownerDocument[expando] = expanID;
        expandoData[expanID] = data;
    }
    return data;
  }
885351
public function expandData(array $data)
    {
        $fields = $this->schema->getFields();
        $table = $this->schema->getName();

        foreach ($fields as $field) {
            $name = $table . '_' . $field['name'];

            //if there's no data
            //or already is an array
            //or not a JSON type
            if (!isset($data[$name])
                || is_array($data[$name])
                || !in_array(
                    $field['field']['type'],
                    [
                        'multiselect',
                        'checkboxes',
                        'filelist',
                        'imagelist',
                        'tag',
                        'textlist',
                        'textarealist',
                        'wysiwyglist',
                        'meta',
                        'multirange',
                        'rawjson',
                        'fieldset',
                        'table',
                        'latlng'
                    ]
                )
            ) {
                //no need to expand
                continue;
            }

            $data[$name] = json_decode($data[$name], true);
        }

        return $data;
    }
737932
def to_table(data, headers)
      column_lengths = []
      gutter = 2
      table = ''

      # Figure out column widths based on longest string in each column (including the header string)
      headers.each { |header|
        width = data.map { |_| _[header] }.max_by(&:length).length

        width = header.length if width < header.length

        column_lengths << width
      }

      # format the length of a table cell string to make it as wide as the column (by adding extra spaces)
      format_row_entry = lambda { |entry, i|
        entry + (' ' * (column_lengths[i] - entry.length + gutter))
      }

      # Add headers
      headers.each_with_index { |header, i|
        table += format_row_entry.call(header, i)
      }

      table += "\n"

      # Add line breaks under headers
      column_lengths.each { |length|
        table += (('-' * length) + (' ' * gutter))
      }

      table += "\n"

      # Add rows
      data.each { |row|
        headers.each_with_index { |header, i|
          table += format_row_entry.call(row[header], i)
        }

        table += "\n"
      }

      table
    end
90132
function createContentLeftNumColRow(index) {
    var row = this.dataSourceObj.rows[index];
    var rootObj = row.value;
    var objAry = this.selectRows;
    var re = objCompare(rootObj, objAry);
    var htmlStr;
    var heightStr = '';

    if (!this.options.needResetHeight) {
        heightStr = 'height:' + (this.options.rowHeight + 1) + 'px;';
    }
    if (re) {
        htmlStr = '<div style="width:' + this.numWidth + 'px;' + heightStr + '" class="u-grid-content-num  u-grid-content-sel-row">' + (index + 1) + '</div>';
    } else {
        htmlStr = '<div style="width:' + this.numWidth + 'px;' + heightStr + '" class="u-grid-content-num">' + (index + 1) + '</div>';
    }
    return htmlStr;
}
990678
function(data) {
            var self    = this,
                render  = null,
                el      = null,
                temp    = null,
                output  = '';

            self.callActions('beforeRender', arguments);

            render = self.callFilters('renderRender', self.mixer.config.render.target, arguments);

            if (typeof render !== 'function') {
                throw new TypeError(mixitup.messages.errorDatasetRendererNotSet());
            }

            output = render(data);

            if (output && typeof output === 'object' && h.isElement(output)) {
                el = output;
            } else if (typeof output === 'string') {
                temp = document.createElement('div');
                temp.innerHTML = output;

                el = temp.firstElementChild;
            }

            return self.callFilters('elRender', el, arguments);
        }
189388
def _build_data_block(self, lexer):
        
        data_block = OrderedDict()
        header = ''

        while True:
            token = next(lexer)
            key = token.__class__.__name__

            if key == 'DataHeader':
                header = token.header[1:-1]
                data_block.setdefault(header, [])

            elif key == 'DataItem':
                data_block[header].append(token.data_item)

            elif key == 'DataBlockEnd':
                break

            else:
                raise KeyError('SDfile data block does not supposed to have any other information: "{}".'.format(key))

        return data_block
665665
function updateTableData( columnIndex ) {
  let cell;
  const rows = this.ui.tableBody.querySelectorAll( 'tr' );
  this.tableData = [];
  columnIndex = columnIndex || this.sortColumnIndex;

  for ( let i = 0, len = rows.length; i < len; ++i ) {
    cell = rows[i].cells[columnIndex];
    if ( cell ) {
      cell = cell.textContent.trim();
    }
    this.tableData.push( [ cell, rows[i] ] );
  }

  const sortType = this.ui.sortButton.getAttribute( 'data-sort_type' );
  this.tableData.sort( this.tableDataSorter( this.sortDirection, sortType ) );

  return this.tableData;
}
28042
def rst_table(data, header=None, fmt=None):
    
    if header is None and hasattr(data, '_fields'):
        header = data._fields
    try:
        # see if data is a composite numpy array
        data.dtype.fields
    except AttributeError:
        # not a composite array
        header = header or ()
    else:
        if not header:
            header = [col.split(':')[0] for col in build_header(data.dtype)]
    if header:
        col_sizes = [len(col) for col in header]
    else:
        col_sizes = [len(str(col)) for col in data[0]]
    body = []
    fmt = functools.partial(scientificformat, fmt=fmt) if fmt else form
    for row in data:
        tup = tuple(fmt(c) for c in row)
        for (i, col) in enumerate(tup):
            col_sizes[i] = max(col_sizes[i], len(col))
        if len(tup) != len(col_sizes):
            raise ValueError('The header has %d fields but the row %d fields!'
                             % (len(col_sizes), len(tup)))
        body.append(tup)

    sepline = ' '.join(('=' * size for size in col_sizes))
    templ = ' '.join(('%-{}s'.format(size) for size in col_sizes))
    if header:
        lines = [sepline, templ % tuple(header), sepline]
    else:
        lines = [sepline]
    for row in body:
        lines.append(templ % row)
    lines.append(sepline)
    return '\n'.join(lines)