【发布时间】:2021-11-02 05:39:16
【问题描述】:
我有一张表,并在 Blade 上用这张表检索了一些数据。
现在我添加了一个复选框作为该表的第一列。
<form method="POST" action="{{ route('finalFestival') }}">
@csrf
<table class="table table-sm table-bordered table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>Choose to pay</th>
<th>Tracking Code</th>
<th>Date of Submission</th>
...
</tr>
</thead>
<tbody>
@foreach( $my_plans as $plan )
<tr>
<td><input class="form-check-input" name="choose_to_pay" type="radio" value="checked"></td>
<td><input type="text" name="fsp_id" value="{{ $plan->fsp_id }}"></td>
<td><input type="text" name="plan_date" value="{{ jdate( strtotime( $plan->created_at ) )->format( 'Y/m/d' ) }}"></td>
....
</tr>
@endforeach
</tbody>
</table>
<button class="btn btn-primary" type="submit">Submit</button>
</form>
这个输出在这里:
screenshot of current table layout
但如果<input> 出现在它的值周围,我不会看到白色区域。我只想用name 和他们的自定义value 显示输入,就像<table> 行的默认行为一样:
在上图中,我没有为每个 <td> 指定任何 <input>,只要我定义它们,它就会显示输入值,周围有空格。
那么如何删除这个空格并像默认表<td>一样显示输入?
【问题讨论】:
标签: php css laravel forms laravel-5.8