【问题标题】:How to show table rows as form inputs without affecting style of table rows如何在不影响表格行样式的情况下将表格行显示为表单输入
【发布时间】: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

但如果&lt;input&gt; 出现在它的值周围,我不会看到白色区域。我只想用name 和他们的自定义value 显示输入,就像&lt;table&gt; 行的默认行为一样:

screenshot of desired table

在上图中,我没有为每个 &lt;td&gt; 指定任何 &lt;input&gt;,只要我定义它们,它就会显示输入值,周围有空格。

那么如何删除这个空格并像默认表&lt;td&gt;一样显示输入?

【问题讨论】:

    标签: php css laravel forms laravel-5.8


    【解决方案1】:
    input{
        background-color : #e4e4e4;
        border : none;
        outline : none;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-15
      • 2013-02-14
      • 1970-01-01
      • 2022-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-10
      相关资源
      最近更新 更多