Generates a "correct" table tag to contain the rendered rows

@param Table $table
@param array $rows
@param array $headers
@param array $footers

@return string
559859
protected function container(Table $table, array $rows, array $headers, array $footers)
	{
		$html = '<table';
		$this->addAttributes($html, $table->getAttributes());
		$html .= '><thead>';
		$html .= implode("\n", $headers);
		$html .= '</thead><tbody>';
		$html .= implode("\n", $rows);
		$html .= '</tbody><tfoot>';
		$html .= implode("\n", $footers);
		$html .= '</tfoot></table>';

		return $html;
	}
389622
public function table(Table\Table $table)
    {
        $data = [];
        foreach($table->getRows() as $row) {

            $line = [];
            foreach($table->getColumns() as $name => $column) {
                $line[] = $column->render((array) $row);
            }

            $data[] = $line;
        }

        return $data;
    }
506379
private function createTopHeadingRow(array $rows)
    {
        $elements = array();

        if ($this->options[self::GRID_PARAM_BATCH] === true) {
            $checkbox = Element::checkbox(null, false, array(), false);
            $elements[] = $this->createColumn(null, $checkbox);
        }

        foreach ($rows as $row) {
            // Ignore if configuration for current column isn't provided
            if (!$this->hasColumnConfiguration($row[self::GRID_PARAM_COLUMN])) {
                continue;
            }

            $column = isset($row[self::GRID_PARAM_COLUMN]) ? $row[self::GRID_PARAM_COLUMN] : null;
            // Use label if provided explicitly, otherwise use normalized column name as a fallback
            $label = isset($row[self::GRID_PARAM_LABEL]) ? $row[self::GRID_PARAM_LABEL] : TextUtils::normalizeColumn($row[self::GRID_PARAM_COLUMN]);

            // If sorting isn't defined, then assume that it's true by default
            if (!isset($row[self::GRID_PARAM_SORTING]) && isset($row[self::GRID_PARAM_FILTER]) && $row[self::GRID_PARAM_FILTER] == true) {
                $row[self::GRID_PARAM_SORTING] = true;
            } else {
                $row[self::GRID_PARAM_SORTING] = false;
            }

            // If translation isn't defined, assume true by default
            if (!isset($row[self::GRID_PARAM_TRANSLATE])) {
                $row[self::GRID_PARAM_TRANSLATE] = true;
            }

            // Translate if required
            if ($row[self::GRID_PARAM_TRANSLATE] == true && $this->hasTranslator()) {
                $label = $this->translator->translate($label);
            }

            // Creating a link or raw text here
            if ($row[self::GRID_PARAM_SORTING] === true) {
                // Use explicit key parameter for sorting if provided
                $inputName = isset($row[self::GRID_PARAM_NAME]) ? $row[self::GRID_PARAM_NAME] : $column;

                $elements[] = $this->createHeader($this->createHeaderLink($inputName, ' ' . $label));
            } else {
                $elements[] = $this->createTextHeader($label);
            }
        }

        if ($this->hasActions()) {
            $actionLabel = 'Actions';
            $actionLabel = $this->hasTranslator() ? $this->translator->translate($actionLabel) : $actionLabel;
            $elements[] = $this->createTextHeader($actionLabel);
        }

        return $this->createTableRow($elements);
    }
202456
public function bulkinsert(Table $table, $rows)
    {
        $end = $this->startCommandTimer();
        $this->writeCommand('bulkinsert', [$table->getName()]);
        parent::bulkinsert($table, $rows);
        $end();
    }
1269183
def headers(row = nil)
      row ||= rows.first
      header_type = row.th.exist? ? 'th' : 'td'
      row.send("#{header_type}s")
    end
962540
public function generateTableBody(array $tableData = array(), $visibleColumns = array())
    {
        $_table_body = "";

        if (!empty($tableData)) {
            foreach ($tableData as $_row) {
                $_tr_data = "";
                foreach ($visibleColumns as $key => $_column) {
                    $_tr_data .= $this->generateTD($_row[$_column->getName()]);
                }
                $_table_body .= $this->generateTR($_tr_data);
            }
        } else {
            $_table_body = $this->generateElement('tr', array(), $this->generateElement('td', array('style' => 'text-align: center', 'colspan' => "".sizeof($visibleColumns)), "<em>No records found</em>", true) , true);
        }

        return $this->generateElement('tbody', array(), $_table_body, true);
    }
183066
public static function build(Table $table, array $columns = [])
    {
        $index = new Index();
        $index->setColumns($columns);

        return new static($table, $index);
    }
1203206
protected function renderTable($table)
    {
        if (is_array($table)) {
            $array = $table;
            if (self::shouldWrapArrayBeforeRendering($array, $wrapSingleValues = true)) {
                $array = array($array);
            }

            foreach ($array as $key => $tab) {
                if ($tab instanceof DataTable\Map
                    || $tab instanceof DataTable
                    || $tab instanceof DataTable\Simple) {
                    $array[$key] = $this->convertDataTableToArray($tab);

                    if (!is_array($array[$key])) {
                        $array[$key] = array('value' => $array[$key]);
                    }
                }
            }
        } else {
            $array = $this->convertDataTableToArray($table);
        }

        if (!is_array($array)) {
            $array = array('value' => $array);
        }

        // decode all entities
        $callback = function (&$value, $key) {
            if (is_string($value)) {
                $value = html_entity_decode($value, ENT_QUOTES, "UTF-8");
            };
        };
        array_walk_recursive($array, $callback);

        // silence "Warning: json_encode(): Invalid UTF-8 sequence in argument"
        $str = @json_encode($array);

        if ($str === false
            && json_last_error() === JSON_ERROR_UTF8
            && $this->canMakeArrayUtf8()) {
            $array = $this->makeArrayUtf8($array);
            $str = json_encode($array);
        }

        return $str;
    }
110446
function markdown_table (headers, table) {
	// FIXME: Implement better markdown table formating
	return ARRAY([headers, [ "---", "---" ]]).concat(table).map(cols => '| ' + ARRAY(cols).join(' | ') + ' |').join('\n');
}
365022
public function theServerShouldReturnHeaders(TableNode $headers)
    {
        Assertions::assertNotNull($this->response, 'Missing response. Can you not send request?');
        $responseHeaders = [];

        foreach ($this->response->getHeaders() as $name => $value) {
            $responseHeaders[strtolower($name)] = $value;
        }

        foreach ($headers->getRowsHash() as $headerName => $headerValue) {
            $headerName = strtolower($headerName);

            Assertions::assertArrayHasKey($headerName, $responseHeaders, 'Missing header in response.');

            $responseHeader = $responseHeaders[$headerName];
            $responseHeader = implode('; ', $responseHeader);

            Assertions::assertEquals($headerValue, $responseHeader, 'The header is not equals.');
        }
    }
1034122
public static function table($table, $columns, $rows) {
		if (count($rows)) {
			$return = new Table;
			$return->rows($rows);
			foreach ($columns as $column) {
				$return->column($column->name, $column->type, $column->title);
			}
			if (isset($table->fields->deleted_at)) $return->deletable();
			if (array_keys($table->order_by)[0] == $table->name . '.precedence') $return->draggable(action('\LeftRight\Center\Controllers\RowController@reorder', $table->name));
			if (!empty($table->group_by)) $return->groupBy('group');
			return $return->draw($table->name);
		}
	}
1059310
public function renderTableNode(TableNode $table)
    {
        $arguments = '<table class="argument"> <thead>';
        $header = $table->getRow(0);
        $arguments .= $this->preintTableRows($header);

        $arguments .= '</thead><tbody>';
        foreach ($table->getHash() as $row) {
            $arguments .= $this->preintTableRows($row);
        }

        $arguments .= '</tbody></table>';

        return $arguments;
    }
364798
public function rowsFrom(string $table, string ...$tables)
    {
        array_unshift($tables, $table);

        foreach ($tables as $table) {
            $this->rowsFrom[] = $this->dialect()->quoteName($table);
        }

        return $this;
    }
608232
private function createIndex(Table $table, array $columns)
    {
        if (count($columns) > 0) {
            $indexPrefix = "idx_" . RdsDeliveryExecutionService::TABLE_NAME . "_";

            // Index names are limited to 63 characters in PostgreSQL (64 in MySQL)
            $indexName = substr($indexPrefix . implode("_", $columns), 0, 63);

            $table->addIndex($columns, $indexName);
        }
    }
289375
public static TabularResult of(final HeaderDefinition headerDefinition, final List<Row> rows) {
    ArgumentChecker.notNull(headerDefinition, "headerDefinition");
    ArgumentChecker.notNull(rows, "rows");
    return new TabularResult(headerDefinition, rows);
  }
1226611
protected function insertPrepared( $table, $rows ) {

        $columns = $this->getColumns( $rows );
        if ( empty( $columns ) ) return;

        $query = $this->insertHead( $table, $columns );
        $query .= "( ?" . str_repeat( ", ?", count( $columns ) - 1 ) . " )";

        $statement = $this->prepare( $query );

        foreach ( $rows as $row ) {

            $values = array();

            foreach ( $columns as $column ) {

                $value = (string) $this->format( @$row[ $column ] );
                $values[] = $value;

            }

            $this->onQuery( $query, $values );

            $statement->execute( $values );

        }

        return $statement;

    }
935163
function tableDoesNotHaveHeaderRow(rows) {
        var headerRow = rows[0];

        var headerCells = headerRow.children;

        for (var i = 0; i < headerCells.length; i++) {
            if (headerCells[i].tagName != 'TH') {
                return true;
            }
        }
        return false;
    }