Renders a pretty plain-text table.
347866
def to_s
      rendered_rows = [separator] + text_table_rows.map(&:to_s) + [separator]
      rendered_rows.unshift [separator, text_table_head.to_s] if head
      rendered_rows << [text_table_foot.to_s, separator] if foot
      rendered_rows.join
    end
351704
public function render_table()
    {
        $ret = array();
        if (!is_array($this->args['table'])) {
            return;
        }
        foreach ($this->args['table'] as $row) {
            list($table, $alias) = $row;

            if (is_string($table)) {
                // table name passed as string
                $table = $this->bt($table);

            } elseif ($table instanceof DB_dsql) {
                // table passed as DSQL expression

                // remove SQL_CALC_FOUND_ROWS from subquery
                $i = @array_search('SQL_CALC_FOUND_ROWS', $table->args['options']);
                if ($i !== false) {
                    unset($table->args['options'][$i]);
                }

                // consume subquery
                $table = $this->consume($table);
            }

            if ($alias !== UNDEFINED && $alias) {
                $table .= ' '.$this->bt($alias);
            }

            $ret[] = $table;
        }

        return implode(',', $ret);
    }
851000
public function render()
    {
        
        // Render the table container
        $output = "<table {$this->renderAttributes()} >\n\t<tbody>\n";
        
        // Render the heading
        $output .= "\t\t<th>\n";
        
        foreach ($this->_head as $heading) {
            
            $output .= "\t\t\t<td>{$heading}</td>\n";
            
        }
        
        $output .= "\t\t</th>\n";
        
        // Render the rows
        foreach($this->_rows as $row) {
            
            $output .= "\t\t<tr>\n";
            
            foreach($this->_head as $columnName) {
                
                $column = $row[$columnName];
                
                switch(gettype($column)) {
                    
                    case 'array':
                        $column = print_r($column, true);
                        break;
                    
                    case 'object':
                        $column = (method_exists($column, 'render')) ? $column->render() : 'Object';
                        break;
                    
                    case 'boolean':
                        $column = $column ? 'True' : 'False';
                        break;
                    
                    case 'unknown type':
                    case 'resource':
                    case 'NULL':
                        $column = 'NULL';
                    
                    default:
                        break;
                    
                }
                
                $output .= "\t\t\t<td>{$column}</td>\n";
                
            }
            
            $output .= "\t\t</tr>\n";
            
        }
        
        $output .= "\t</tbody>\n</table>";
        
        return $output;
        
    }
283534
public function renderTableBody()
	{
		if (!empty($this->mergeColumns) || !empty($this->extraRowColumns)) {
			$this->groupByColumns();
		}

		parent::renderTableBody();
	}
439903
def _format_table(fmt, headers, rows, colwidths, colaligns, is_multiline):
    """"""
    lines = []
    hidden = fmt.with_header_hide if (headers and fmt.with_header_hide) else []
    pad = fmt.padding
    headerrow = fmt.headerrow

    padded_widths = [(w + 2 * pad) for w in colwidths]
    if is_multiline:
        pad_row = lambda row, _: row  # do it later, in _append_multiline_row
        append_row = partial(_append_multiline_row, pad=pad)
    else:
        pad_row = _pad_row
        append_row = _append_basic_row

    padded_headers = pad_row(headers, pad)
    padded_rows = [pad_row(row, pad) for row in rows]

    if fmt.lineabove and "lineabove" not in hidden:
        _append_line(lines, padded_widths, colaligns, fmt.lineabove)

    if padded_headers:
        append_row(lines, padded_headers, padded_widths, colaligns, headerrow)
        if fmt.linebelowheader and "linebelowheader" not in hidden:
            _append_line(lines, padded_widths, colaligns, fmt.linebelowheader)

    if padded_rows and fmt.linebetweenrows and "linebetweenrows" not in hidden:
        # initial rows with a line below
        for row in padded_rows[:-1]:
            append_row(lines, row, padded_widths, colaligns, fmt.datarow)
            _append_line(lines, padded_widths, colaligns, fmt.linebetweenrows)
        # the last row without a line below
        append_row(lines, padded_rows[-1], padded_widths, colaligns, fmt.datarow)
    else:
        for row in padded_rows:
            append_row(lines, row, padded_widths, colaligns, fmt.datarow)

    if fmt.linebelow and "linebelow" not in hidden:
        _append_line(lines, padded_widths, colaligns, fmt.linebelow)

    return "\n".join(lines)
64144
function renderList(list, theme) {


    var txtDiv = document.createElement("table");
    txtDiv.className = 'table table-condensed table-bordered table-hover-' + theme;
    //bootstrapInterface.info(txtDiv.className);

    /**
     * Header
     */
    var tHead = addEle(txtDiv, 'thead');
    var tHeadRow = addEle(tHead, 'tr');
    for (j = 1; j < list.model.attributes.length; j++) { // skip id (0))
      var hAttribute = list.model.attributes[j];
      if (hAttribute.hidden == undefined)
        addEle(tHeadRow, 'th').innerHTML = hAttribute.label;
    }

    /**
     * Now each row in list
     */
    var gotData = list.moveFirst();
    var tBody = addEle(txtDiv, 'tbody');
    while (gotData) {
      var tBodyRow = addEle(tBody, 'tr');
      var idAttribute = list.model.attributes[0];
      $(tBodyRow).data("id", list.get(idAttribute.name));
      $(tBodyRow).click(function (e) {
        // bootstrapInterface.dispatch(new Request({type: 'Command', command: action}));
        // bootstrapInterface.info('you picked #' + $(e.currentTarget).data("id"));
        if (list.pickKludge)
          list.pickKludge($(e.currentTarget).data("id")); // too shitty balls
        e.preventDefault();
      });

      for (j = 1; j < list.model.attributes.length; j++) { // skip id (0))
        var dAttribute = list.model.attributes[j];
        if (dAttribute.hidden == undefined) {
          var dValue = list.get(dAttribute.name);
          switch (dAttribute.type) {
            case 'Date':
              //console.log('dValue=' + dValue);
              // addEle(tBodyRow, 'td').innerHTML = left(dValue.toISOString(), 10);
              // addEle(tBodyRow, 'td').innerHTML = dValue.toString(); // todo use moment.js
              if (dValue)
                addEle(tBodyRow, 'td').innerHTML = left(dValue.toISOString(), 10);
              else
                addEle(tBodyRow, 'td').innerHTML = '&nbsp;';
              break;
            case 'Boolean':
              if (dValue)
                addEle(tBodyRow, 'td').innerHTML = '<i class="fa fa-check-square-o"></i>';
              else
                addEle(tBodyRow, 'td').innerHTML = '<i class="fa fa-square-o"></i>';
              break;
            default:
              if (dValue && dValue.name) // todo instanceof Attribute.ModelID did not work so kludge here
                addEle(tBodyRow, 'td').innerHTML = dValue.name;
              else
                addEle(tBodyRow, 'td').innerHTML = dValue;
          }
        }
      }
      gotData = list.moveNext();
    }
    panel.panelForm.appendChild(txtDiv);

  }
1077337
private void renderSimpleTab(Collection<I_CmsFormField> fields) {

        for (I_CmsFormField field : fields) {
            m_simpleTab.add(createRow(field));
        }
        CmsDomUtil.resizeAncestor(m_simpleTab.getParent());
    }
1028413
def render(format = :html, css_class = 'screen', css_style = nil)
			result = case format
			when :text
				''
			when :html
				%Q|<pre#{css_class ? %Q[ class="#{css_class}"] : ''}#{css_style ? %Q| style="#{css_style}"| : ''}>\n|
			else
				raise AnsiSysError, "Invalid format option to render: #{format.inspect}"
			end

			unless @lines.keys.empty?
				prev_sgr = nil
				max_row = @lines.keys.max
				(1..max_row).each do |row|
					if @lines.has_key?(row) and not @lines[row].keys.empty?
						col = 1
						while col <= @lines[row].keys.max
							if @lines[row].has_key?(col) and @lines[row][col]
								char, width, sgr = @lines[row][col]
								if prev_sgr != sgr
									result += prev_sgr.render(format, :postfix, @colors) if prev_sgr
									result += sgr.render(format, :prefix, @colors)
									prev_sgr = sgr
								end
								case format
								when :text
									result += char
								when :html
									result += WEBrick::HTMLUtils.escape(char)
								end
								col += width
							else
								result += ' '
								col += 1
							end
						end
					end
					result += "\n" if row < max_row
				end
				result += prev_sgr.render(format, :postfix, @colors) if prev_sgr
			end

			result += case format
			when :text
				''
			when :html
				'</pre>'
			end
			return result
		end
343287
def render_table(data, headers=None):
    
    builder = HtmlBuilder()
    builder._render_objects(data, headers, datatype='dict')
    return builder._to_html()
1233108
private void paintCell(SeaGlassContext context, Graphics g, Rectangle cellRect, int row, int column) {
        if (table.isEditing() && table.getEditingRow() == row && table.getEditingColumn() == column) {
            Component component = table.getEditorComponent();

            component.setBounds(cellRect);
            component.validate();
        } else {
            TableCellRenderer renderer  = table.getCellRenderer(row, column);
            Component         component = table.prepareRenderer(renderer, row, column);

            rendererPane.paintComponent(g, component, table, cellRect.x, cellRect.y, cellRect.width, cellRect.height, true);
        }
    }
794548
def render
      buffer = []
      _guess_col_widths
      rows = @list.size.to_s.length
      @rows = rows
      _prepare_format
      
      str = ""
      if @numbering
        str = " "*(rows+1)+@y
      end
      str <<  @fmstr % @columns
      buffer << str
      #puts "-" * str.length
      buffer << separator
      if @list
        if @numbering
          @fmstr = "%#{rows}d "+ @y + @fmstr
        end
        #@list.each { |e| puts e.join(@y) }
        count = 0
        @list.each_with_index { |r,i|  
          value = convert_value_to_text r, count
          buffer << value
          count += 1
        }
      end
      buffer
    end
257093
public function renderTableFooter()
	{
		$hasFilter = $this->filter !== null && $this->filterPosition === self::FILTER_POS_FOOTER;

		$hasFooter = $this->getHasFooter();
		if ($this->bulk !== null || $hasFilter || $hasFooter) {
			echo "<tfoot>\n";
			if ($hasFooter) {
				echo "<tr>\n";
				/** @var $column CDataColumn */
				foreach ($this->columns as $column) {
					$column->renderFooterCell();
				}
				echo "</tr>\n";
			}
			if ($hasFilter) {
				$this->renderFilter();
			}

			if ($this->bulk !== null) {
				$this->renderBulkActions();
			}
			echo "</tfoot>\n";
		}
	}
644336
def rendered_text(self):
        
        if len(self._plain_images) <= 0:
            self._convert_images()

        if self._animation is None:
            index = self._index
            self._index += 1
            if self._index >= len(self._plain_images):
                self._index = 0
        else:
            index = self._animation()
        return (self._plain_images[index],
                self._colour_map[index])
911724
protected void renderList(final MBasicTable table, final Table datatable)
			throws BadElementException {
		final int columnCount = table.getColumnCount();
		final int rowCount = table.getRowCount();
		// data rows
		final Font font = FontFactory.getFont(FontFactory.HELVETICA, 10, Font.NORMAL);
		datatable.getDefaultCell().setBorderWidth(1);
		datatable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
		// datatable.setDefaultCellGrayFill(0);
		Object value;
		String text;
		int horizontalAlignment;
		for (int k = 0; k < rowCount; k++) {
			for (int i = 0; i < columnCount; i++) {
				value = getValueAt(table, k, i);
				if (value instanceof Number || value instanceof Date) {
					horizontalAlignment = Element.ALIGN_RIGHT;
				} else if (value instanceof Boolean) {
					horizontalAlignment = Element.ALIGN_CENTER;
				} else {
					horizontalAlignment = Element.ALIGN_LEFT;
				}
				datatable.getDefaultCell().setHorizontalAlignment(horizontalAlignment);
				text = getTextAt(table, k, i);
				datatable.addCell(new Phrase(8, text != null ? text : "", font));
			}
		}
	}
325480
function createTable (context) {
  var result = '"' + context.typeName + '" '
  result +=
    '[label=<<TABLE COLOR="' +
    context.color +
    '" BORDER="0" CELLBORDER="1" CELLSPACING="0">'
  result +=
    '<TR><TD PORT="__title"' +
    (this.theme.header.invert ? ' BGCOLOR="' + context.color + '"' : '') +
    '><FONT COLOR="' +
    (this.theme.header.invert ? 'WHITE' : context.color) +
    '">' +
    (_.isEmpty(context.stereotype) || context.stereotype === 'null'
      ? ''
      : '&laquo;' + context.stereotype + '&raquo;<BR/>') +
    '<B>' +
    context.typeName +
    '</B></FONT></TD></TR>'
  if (context.rows.length) {
    if (this.theme.field.hideSeperators) {
      result +=
        '<TR><TD><TABLE COLOR="' +
        context.color +
        '" BORDER="0" CELLBORDER="0" CELLSPACING="0">'
    }
    result += context.rows.map(row => {
      return (
        '<TR><TD ALIGN="' +
        this.theme.field.align +
        '" PORT="' +
        row.port +
        '"><FONT COLOR="' +
        context.color +
        '">' +
        row.text +
        '</FONT></TD></TR>'
      )
    })
    if (this.theme.field.hideSeperators) {
      result += '</TABLE></TD></TR>'
    }
  }
  result += '</TABLE>>];'
  return result
}
27597
def render(self, display):
        """"""
        # to handle changing objects / callable
        if self.text != self._last_text:
            self._render()

        display.blit(self._surface, (self.topleft, self.size))
136752
def pretty_print_table(headers, rows):
    """"""
    table = make_table(headers=headers, rows=rows)
    pretty_print_table_instance(table)