Generate the <tbody> part of the table.
514819
protected function display_rows_or_placeholder()
    {
        if ($this->has_items()) {
            $this->display_rows();
        } else {
            list($columns, $hidden) = $this->get_column_info();
            echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
            $this->no_items();
            echo '</td></tr>';
        }
    }
1049208
function createTableHtml(renderData) {
  const thead = [renderData[0]];
  const tbody = renderData.slice(1);
  const theadHtml = _createTheadOrTbodyHtml(thead, 'THEAD');
  const tbodyHtml = _createTheadOrTbodyHtml(tbody, 'TBODY');
  const className = renderData.className ? ` class="${renderData.className}"` : '';

  return `<table${className}>${theadHtml + tbodyHtml}</renderData>`;
}
647587
def convert_table(app, docname, source):
    """"""
    num_tables = 0
    for i,j in enumerate(source):
        table = []
        output = ''
        in_table = False
        for l in j.split('\n'):
            r = l.strip()
            if r.startswith('|'):
                table.append(r)
                in_table = True
            else:
                if in_table is True:
                    converted = _convert_md_table_to_rst(table)
                    if converted is '':
                        print("Failed to convert the markdown table")
                        print(table)
                    else:
                        num_tables += 1
                    output += converted
                    in_table = False
                    table = []
                output += l + '\n'
        source[i] = output
    if num_tables > 0:
        print('Converted %d tables in %s' % (num_tables, docname))
1298432
def generate_schema(table, export_fields, output_format, output_fobj):
    

    if output_format in ("csv", "txt"):
        from rows import plugins

        data = [
            {
                "field_name": fieldname,
                "field_type": fieldtype.__name__.replace("Field", "").lower(),
            }
            for fieldname, fieldtype in table.fields.items()
            if fieldname in export_fields
        ]
        table = plugins.dicts.import_from_dicts(
            data, import_fields=["field_name", "field_type"]
        )
        if output_format == "txt":
            plugins.txt.export_to_txt(table, output_fobj)
        elif output_format == "csv":
            plugins.csv.export_to_csv(table, output_fobj)

    elif output_format == "sql":
        # TODO: may use dict from rows.plugins.sqlite or postgresql
        sql_fields = {
            rows.fields.BinaryField: "BLOB",
            rows.fields.BoolField: "BOOL",
            rows.fields.IntegerField: "INT",
            rows.fields.FloatField: "FLOAT",
            rows.fields.PercentField: "FLOAT",
            rows.fields.DateField: "DATE",
            rows.fields.DatetimeField: "DATETIME",
            rows.fields.TextField: "TEXT",
            rows.fields.DecimalField: "FLOAT",
            rows.fields.EmailField: "TEXT",
            rows.fields.JSONField: "TEXT",
        }
        fields = [
            "    {} {}".format(field_name, sql_fields[field_type])
            for field_name, field_type in table.fields.items()
            if field_name in export_fields
        ]
        sql = (
            dedent(
                """
                CREATE TABLE IF NOT EXISTS {name} (
                {fields}
                );
                """
            )
            .strip()
            .format(name=table.name, fields=",\n".join(fields))
            + "\n"
        )
        output_fobj.write(sql)

    elif output_format == "django":
        django_fields = {
            rows.fields.BinaryField: "BinaryField",
            rows.fields.BoolField: "BooleanField",
            rows.fields.IntegerField: "IntegerField",
            rows.fields.FloatField: "FloatField",
            rows.fields.PercentField: "DecimalField",
            rows.fields.DateField: "DateField",
            rows.fields.DatetimeField: "DateTimeField",
            rows.fields.TextField: "TextField",
            rows.fields.DecimalField: "DecimalField",
            rows.fields.EmailField: "EmailField",
            rows.fields.JSONField: "JSONField",
        }
        table_name = "".join(word.capitalize() for word in table.name.split("_"))

        lines = ["from django.db import models"]
        if rows.fields.JSONField in [
            table.fields[field_name] for field_name in export_fields
        ]:
            lines.append("from django.contrib.postgres.fields import JSONField")
        lines.append("")

        lines.append("class {}(models.Model):".format(table_name))
        for field_name, field_type in table.fields.items():
            if field_name not in export_fields:
                continue

            if field_type is not rows.fields.JSONField:
                django_type = "models.{}()".format(django_fields[field_type])
            else:
                django_type = "JSONField()"
            lines.append("    {} = {}".format(field_name, django_type))

        result = "\n".join(lines) + "\n"
        output_fobj.write(result)
972156
def generate_table(self, rows):
        
        table = PrettyTable(**self.kwargs)
        for row in self.rows:
            if len(row[0]) < self.max_row_width:
                appends = self.max_row_width - len(row[0])
                for i in range(1, appends):
                    row[0].append("-")

            if row[1] is True:
                self.make_fields_unique(row[0])
                table.field_names = row[0]
            else:
                table.add_row(row[0])
        return table
400807
def _ods2code(self):
        """"""

        ods = ODSReader(self.ods_file, clonespannedcolumns=True)
        tables = ods.sheets
        for tab_id, table in enumerate(tables):
            for row_id in xrange(len(table)):
                for col_id in xrange(len(table[row_id])):
                    key = row_id, col_id, tab_id
                    text = unicode(table[row_id][col_id])
                    self.code_array[key] = text
1353280
def generate(self):
        """"""

        ts=self.generate_tobs()
        noise=self.generate_noise(ts)
        
        rvs=[]
        for t,n in zip(ts, noise):
            rvs.append(n + np.sum(rv.rv_model(t, self.params), axis=0))

        return ts,rvs
847432
def to_table_data(self):
        

        self._validate_source_data()

        header_list = []
        for json_record in self._buffer:
            for key in json_record:
                if key not in header_list:
                    header_list.append(key)

        self._loader.inc_table_count()

        yield TableData(
            self._make_table_name(),
            header_list,
            self._buffer,
            dp_extractor=self._loader.dp_extractor,
            type_hints=self._extract_type_hints(header_list),
        )
495878
def extract_table(tabletag):
    # type: (Tag) -> List[Dict]
    
    theadtag = tabletag.find_next('thead')

    headertags = theadtag.find_all('th')
    if len(headertags) == 0:
        headertags = theadtag.find_all('td')
    headers = []
    for tag in headertags:
        headers.append(get_text(tag))

    tbodytag = tabletag.find_next('tbody')
    trtags = tbodytag.find_all('tr')

    table = list()
    for trtag in trtags:
        row = dict()
        tdtags = trtag.find_all('td')
        for i, tag in enumerate(tdtags):
            row[headers[i]] = get_text(tag)
        table.append(row)
    return table
825994
public function printAllTableIdFlds($tbl, $flds = [])
    {
        $ret = '';
        $arr = $this->getAllTableIdFlds($tbl, $flds);
        if (sizeof($arr) > 0) {
            foreach ($arr as $i => $row) {
                $ret .= ' (( ';
                if (sizeof($row) > 0) {
                    foreach ($row as $fld => $val) {
                        $ret .= (($fld != 'id') ? ' , ' : '') . $fld . ' : ' . $val;
                    }
                }
                $ret .= ' )) ';
            }
        }
        return $ret;
    }
781980
def export_to_html(
    table, filename_or_fobj=None, encoding="utf-8", caption=False, *args, **kwargs
):
    """"""

    serialized_table = serialize(table, *args, **kwargs)
    fields = next(serialized_table)
    result = ["<table>\n\n"]
    if caption and table.name:
        result.extend(["  <caption>", table.name, "</caption>\n\n"])
    result.extend(["  <thead>\n", "    <tr>\n"])
    # TODO: set @name/@id if self.meta["name"] is set
    header = ["      <th> {} </th>\n".format(field) for field in fields]
    result.extend(header)
    result.extend(["    </tr>\n", "  </thead>\n", "\n", "  <tbody>\n", "\n"])
    for index, row in enumerate(serialized_table, start=1):
        css_class = "odd" if index % 2 == 1 else "even"
        result.append('    <tr class="{}">\n'.format(css_class))
        for value in row:
            result.extend(["      <td> ", escape(value), " </td>\n"])
        result.append("    </tr>\n\n")
    result.append("  </tbody>\n\n</table>\n")
    html = "".join(result).encode(encoding)

    return export_data(filename_or_fobj, html, mode="wb")
394760
def build_unicode_property_table(output):
    """"""

    if not os.path.exists(output):
        os.mkdir(output)
    gen_properties(output)
1329015
def __dumptable(self, table):
        
        for x in table.table.keys():
            sys.stdout.write("{0}\t<--- {1} {2}".format(x, table[x], type(table[x])))
            if isinstance(table[x], ID):
                sys.stdout(" {0}".format(table[x].value)),
            sys.stdout.write("\n")
47113
function tblCells( divId ) {
  log( "Pong-Table", 'tblCells( '+divId +' )' );  
  var dtaArr = poTbl[ divId ].pongTableData;
  var rowSt  = 0;
  var rowEn  = dtaArr.length;
  var i = 0;
  
  if ( poTbl[ divId ].sortCol != '' ) {
    pongTable_sc      = poTbl[ divId ].sortCol;
    pongTable_sort_up = poTbl[ divId ].sortUp;
    //alert( "Sort "+poTbl[ divId ].sortCol );
    dtaArr.sort( pongTableCmpFields );
  }

  // if pagination is required, by a maxRow defintion:
  if ( poTbl[ divId ].pongTableDef.maxRows ) {
    rowSt = parseInt( poTbl[ divId ].pongTableStartRow );
    rowEn = parseInt( poTbl[ divId ].pongTableEndRow );	  
    if ( rowSt > dtaArr.length ) {
      poTbl[ divId ].pongTableStartRow = 0;
      poTbl[ divId ].pongTableEndRow   = poTbl[ divId ].pongTableDef.maxRows;
      rowSt = 0;
      rowEn = poTbl[ divId ].pongTableDef.maxRows;
    }
    log( "Pong-Table", "update paginaor label" );  
    var rPP = parseInt( poTbl[ divId ].pongTableDef.maxRows );
    var maxP = Math.ceil( dtaArr.length / rPP );
    var curP = Math.round( rowEn / rPP );
    $( "#"+divId+'PaginLbl' ).html( $.i18n( "page" )+" "+curP+"/"+maxP+ " ("+dtaArr.length+" "+$.i18n("rows")+")" );
    $( '#'+divId+'PongTable' ).find( "td" ).html( '...' );

  } else {
    // need to create empty table rows and cells 
    // del all rows, except 1st
    $( '#'+divId+'PongTable' ).find( "tr:gt(0)" ).remove();
    
    var contentItems = [];
    for ( var r = 0; r < rowEn; r ++ ) {
      var tbl = poTbl[ divId ].pongTableDef;
      // table:  id="'+divId+'PongTable"
      $( '#'+divId+' .'+divId+'Row' ).remove();
      contentItems.push( '<tr id="'+divId+'R'+r+'" class="'+divId+'Row">' );
      for ( var c = 0; c < tbl.cols.length; c ++ ) {
        if ( ( tbl.cols[c].cellType != 'tooltip' ) && 
            ( tbl.cols[c].cellType != 'largeimg' ) && 
            ( tbl.cols[c].cellType != 'textLink' ) && 
            ( tbl.cols[c].cellType != 'cssClass' ) && 
            ( tbl.cols[c].cellType != 'linkFor' ) ) {
          contentItems.push( '<td id="'+divId+'R'+r+'C'+c+'" class="'+divId+'C'+c+'">...</td>'  );
        }
      }
      contentItems.push( "</tr>" );
    }
    $( '#'+divId+'PongTable' ).append( contentItems.join( '\n' ) );
  }
  
  log( "Pong-Table", "tblCells: divId="+divId+"Data #"+poTbl[ divId ].pongTableData.length + " rowSt="+rowSt + " rowEn="+rowEn );
  
  log( "Pong-Table", "row loop" );	
  for ( var r = rowSt; r < rowEn; r++ ) {
    log( "Pong-Table", "row loop" );	
    var rowIdVal =  dtaArr[r][ poTbl[ divId ].pongTableDef.rowId ];
    //console.log( '>>>>>>>> '+ poTbl[ divId ].pongTableDef.rowId + JSON.stringify(dtaArr[r]) )
    if ( r < dtaArr.length ) {
      log( "Pong-Table", "row "+r );	
      var cellDta = dtaArr[r];
      
      
      for ( var c = 0; c < poTbl[ divId ].pongTableDef.cols.length; c++ ) {
        log( "Pong-Table", "col "+c );	
        var cellDef = poTbl[ divId ].pongTableDef.cols[c];
        var cellId =  '#'+divId+'R'+i+'C'+c; 
        tblUpdateCell( divId, cellDef, r, c, i, cellDta, cellId, rowIdVal, divId );
      }
    } else { // clear the rest of the cells
      for ( var c = 0; c < poTbl[ divId ].pongTableDef.cols.length; c++ ) {
        var cellId =  '#'+divId+'R'+i+'C'+c; 
        $( cellId ).html( '&nbsp;' );
      }
    }
    i++;
  }	
}
947718
def generate_list_table_result(lexicon_logger, output=None, without_header=None):
    """"""
    if not isinstance(output, list):
        lexicon_logger.debug('Command output is not a list, and then cannot '
                             'be printed with --quiet parameter not enabled.')
        return None

    array = [[
        row.get('id', ''),
        row.get('type', ''),
        row.get('name', ''),
        row.get('content', ''),
        row.get('ttl', '')] for row in output]

    # Insert header (insert before calculating the max width of each column
    # to take headers size into account)
    if not without_header:
        headers = ['ID', 'TYPE', 'NAME', 'CONTENT', 'TTL']
        array.insert(0, headers)

    column_widths = [0, 0, 0, 0, 0]
    # Find max width for each column
    for row in array:
        for idx, col in enumerate(row):
            width = len(str(col))
            if width > column_widths[idx]:
                column_widths[idx] = width

    # Add a 'nice' separator
    if not without_header:
        array.insert(1, ['-' * column_widths[idx]
                         for idx in range(len(column_widths))])

    # Construct table to be printed
    table = []
    for row in array:
        row_list = []
        for idx, col in enumerate(row):
            row_list.append(str(col).ljust(column_widths[idx]))
        table.append(' '.join(row_list))

    # Return table
    return os.linesep.join(table)
521585
def copy_table(tbl, start=0, stop=None, blen=None, storage=None,
               create='table', **kwargs):
    """"""

    # setup
    names, columns = _util.check_table_like(tbl)
    storage = _util.get_storage(storage)
    blen = _util.get_blen_table(tbl, blen)
    if stop is None:
        stop = len(columns[0])
    else:
        stop = min(stop, len(columns[0]))
    length = stop - start
    if length < 0:
        raise ValueError('invalid stop/start')

    # copy block-wise
    out = None
    for i in range(start, stop, blen):
        j = min(i+blen, stop)
        res = [c[i:j] for c in columns]
        if out is None:
            out = getattr(storage, create)(res, names=names,
                                           expectedlen=length, **kwargs)
        else:
            out.append(res)

    return out
502165
def gen_table(self):
        
        table_length = 1 << self.TableIdxWidth
        tbl = [0] * table_length
        for i in range(table_length):
            register = i
            if self.ReflectIn:
                register = self.reflect(register, self.TableIdxWidth)
            register = register << (self.Width - self.TableIdxWidth + self.CrcShift)
            for j in range(self.TableIdxWidth):
                if register & (self.MSB_Mask << self.CrcShift) != 0:
                    register = (register << 1) ^ (self.Poly << self.CrcShift)
                else:
                    register = (register << 1)
            if self.ReflectIn:
                register = self.reflect(register >> self.CrcShift, self.Width) << self.CrcShift
            tbl[i] = register & (self.Mask << self.CrcShift)
        return tbl