# row-table **Repository Path**: GhostAi/row-table ## Basic Information - **Project Name**: row-table - **Description**: laravel-admin extension row-table - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2019-11-12 - **Last Updated**: 2020-12-19 ## 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 ``` ## Update it After `composer update` , if version of this extension changed : Run ``` php artisan vendor:publish --tag=row-table --force ``` This will override css and js fiels to `/public/vendor/laravel-admin-ext/row-table/` Or you can and a script in `composer.json` : ```json "scripts": { "post-update-cmd": "php artisan vendor:publish --tag=row-table --force", } ``` ## 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时 头部使用