# stream/3.9.0/classes/class-preview-list-table.php

Stream – Activity Log &amp; Audit Trail, version 3.9.0. 79 lines.

- Page: https://pluginprobe.com/plugins/stream/3.9.0/code/classes/class-preview-list-table.php
- Raw: https://pluginprobe.com/plugins/stream/3.9.0/raw/classes/class-preview-list-table.php
- Modified: 2020-07-08T12:34:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/stream/3.9.0/code/classes/class-preview-list-table.php#L10-L20`.

```php
<?php
/**
 * Displays a list of provided records in a HTML Table
 *
 * @package WP_Stream
 */

namespace WP_Stream;

/**
 * Class - Preview_List_Table
 */
class Preview_List_Table extends List_Table {

	/**
	 * Class constructor.
	 *
	 * @param Plugin $plugin Plugin object.
	 *
	 * @return void
	 */
	public function __construct( $plugin ) {
		$this->plugin = $plugin;
		parent::__construct( $plugin );
	}

	/**
	 * Sets up the records for display.
	 *
	 * @param array $items List of items for display.
	 *
	 * @return void
	 */
	public function set_records( $items ) {
		$columns  = $this->get_columns();
		$sortable = $this->get_sortable_columns();
		$hidden   = $this->get_hidden_columns();
		$primary  = $columns['summary'];

		$this->_column_headers = array(
			$columns,
			$hidden,
			$sortable,
			$primary,
		);

		$this->items = $items;
	}

	/**
	 * Display the table
	 *
	 * @since 3.1.0
	 * @access public
	 */
	public function display() {
		?>
		<table class="wp-list-table <?php esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>">
			<thead>
			<tr>
				<?php $this->print_column_headers(); ?>
			</tr>
			</thead>

			<tbody id="the-list">
			<?php $this->display_rows_or_placeholder(); ?>
			</tbody>

			<tfoot>
			<tr>
				<?php $this->print_column_headers( false ); ?>
			</tr>
			</tfoot>

		</table>
		<?php
	}
}

```
