# row-table
**Repository Path**: yanggg1133/row-table
## Basic Information
- **Project Name**: row-table
- **Description**: table组件,form里面使用table
form里面使用table.
Use table in row of form.
- **Primary Language**: PHP
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-10-14
- **Last Updated**: 2021-10-14
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# laravel-admin row-table
## Installation
Run :
```
$ composer require ichynul/row-table
```
Then run:
```
$ php artisan vendor:publish --tag=row-table
```
#####
##### 推荐使用 $field->setGroupClass('col-md-6');//这样的方式来实现栅格布局,毕竟官方的兼容性更好一些。
##### It is recommended to use $field->setgroupclass('col-md-6'); // this official way to achieve grid layout.
## Usage
```php
protected function form()
{
$form = new Form(new Task);
$headers = ['备注', '服务费用', '服务评分'];
$tableRow = new TableRow();
$tableRow->text('status', '任务状态')->options(Task::$statusMap)->attribute(['readonly' => 'readonly']);
$tableRow->text('fee', '服务费用')->rules('required');
$tableRow->number('rating', '服务评分', 2)->max(5)->min(1);//这个表少了一列,这里设置colspan=2 ,其他可以不写默认1
/*************************************/
$headers2 = ['地址', '评价', '图片'];
$tableRow2 = new TableRow();
$tableRow2->text('address', '地址')->rules('required');
$tableRow2->text('comment', '评价');
$tableRow2->text('username', '姓名');
$tableRow2->text('viwe', '查看');
$form->rowtable('任务信息1')
->setHeaders($headers)//使用table时设置,div设置无效
//->setRows($tableRow)//设置 一个row
->setRows([$tableRow, $tableRow2])
->useDiv(true); //使用div显示,默认 table
//->headersTh(true);//使用table时 头部使用