2017-07-13 5 views
1

私は独自の行を揃えるために、私は(そのテキスト付き)の各入力をしたいので、ブートストラップは、画面が小さい場合には、新しい行にテーブル列を分割する方法を

  <table id="tblFilters" dir="rtl" class="table"> 
      <thead class="filterHead"> 
      <tr class="filterRow"> 
       <th></th> 
       <th></th> 
       <th></th> 
       <th></th> 
      </tr> 
      </thead> 
      <tbody class="filterBody"> 

      <tr class="filterRow"> 
       <td> 
       <span>הצג מתאריך</span> 
       <input type="text" id="dateFrom" /> 
       </td> 
       <td> 
       <span>עד לתאריך</span> 
       <input type="text" id="dateTo" /> 
       </td> 
       <td> 
       <span>שם לקוח\מספר IQC</span> 
       <input type="text" id="iqcNo" /> 
       </td> 
       <td> 
       <asp:Button style="float:left; margin-right:30px;" id="btnRefreshReport" OnClientClick="refreshReport()" runat="server" Text="רענן דוח"/> 
       </td> 
      </tr> 
      </tbody> 
     </table> 

のようなテーブルを持っています(xs/sm)、画面が大きくなるとすべて同じ行になります。

ブートストラップを使用してこれを行うにはどうすればよいですか?

答えて

2

使用メディアクエリと、それらが

怒鳴るの例を参照してください破る作るためにブロックするためにすべてのセルを設定します。

@media only screen and (max-width: 767px) { 
 
    .table>tbody>tr>td, 
 
    .table>tbody>tr>th, 
 
    .table>tfoot>tr>td, 
 
    .table>tfoot>tr>th, 
 
    .table>thead>tr>td, 
 
    .table>thead>tr>th { 
 
    display: block; 
 
    min-width: 100%!important; 
 
    } 
 
    .table>thead>tr>th { 
 
    display: none; 
 
    } 
 
    
 
    .table .filterBody span { 
 
    display:block; 
 
    } 
 
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> 
 
<table id="tblFilters" dir="rtl" class="table"> 
 
    <thead class="filterHead"> 
 
    <tr class="filterRow"> 
 
     <th></th> 
 
     <th></th> 
 
     <th></th> 
 
     <th></th> 
 
    </tr> 
 
    </thead> 
 
    <tbody class="filterBody"> 
 

 
    <tr class="filterRow"> 
 
     <td> 
 
     <span>הצג מתאריך</span> 
 
     <input type="text" id="dateFrom" /> 
 
     </td> 
 
     <td> 
 
     <span>עד לתאריך</span> 
 
     <input type="text" id="dateTo" /> 
 
     </td> 
 
     <td> 
 
     <span>שם לקוח\מספר IQC</span> 
 
     <input type="text" id="iqcNo" /> 
 
     </td> 
 

 
    </tr> 
 
    </tbody> 
 
</table>

+0

をありがとう男を!あなたが気にしなければ、小さな画面サイズの行を上下に並べることも好きです。私の例では、テキストと入力が同じセルになるようにテーブルを変更しました。セルが新しい行に壊れても、正しく配置されていない場合、その方法がありますか? – itay312

+0

@ itay312スパンで同じことをすることができます。小さな画面でブロック要素にしてください。私の編集を参照してください。 – Chiller

+0

ああ、ありがとう!あなたはとても役に立ちました – itay312

関連する問題