# Make Table

# Start Make a Table

For make a table in panel, You must:

use T0team\LaravelPanel\Facades\Panel;

$headers = [
    'id' => 'ID',
    'name' => 'Name',
    'email' => 'Email',
    'created_at' => 'Created At',
    'updated_at' => 'Updated At',
];
# keys of $headers array is key name of data(rows)
# values of $headers array is title of column in table

$panel = Panel::table($headers);

# Add Header

You can add header to table by header & headers methods:

$panel->header('id', 'ID');
# or
$panel->headers(['id' => 'ID', 'name' => 'Name'])

# Add Row

You can add rows to table by row & rows methods:

$panel->row($user);
# or
$panel->rows($users);

# Use with paginate

You can use with paginate by paginate method:

$panel->paginate(User::paginate(10));

# Add Action Button

You can add action button to each row by action method:

use T0team\LaravelPanel\Controllers\Button;

$panel->action(Button::make()->label('buttonText')->...);

# Render Table

You can render table by render method:

return $panel->render();

# Other Methods

Also you can use all methods of Panel Facade in this section.