2012-08-14 109 views
0

我使用模式,以显示表:引导:调整表峰尺寸

 <div class="modal-body"> 
      <form class="form-horizontal"> 
       <label><h5>dev</h5></label> 
       <input type="text" class="input-xlarge" id="dconDev"> 
       <label><h5>speed</h5></label> 
       <input type="text" class="input-xlarge" id="dconSpeed"> 
       <input type="button" class="btn" id="dconBut" onclick="$('#appBlock').fadeIn('normal'); $('#dcon').show(); addPort('dcon',$('#dconDev').val(),$('#dconSpeed').val())" value="Добавить"> 
       <table class="table table-condensed"> 
        <thead> 
         <th>lbl</th> 
         <th>edizm</th> 
         <th>id</th> 
         <th>a</th> 
         <th>b</th> 
         <th>en_spar</th> 
         <th>spar</th> 
         <th>en_period</th> 
         <th>peiod</th> 
        </thead> 
        <tbody id="dconTable"> 
         <th><input type="text" id="lbld"></th> 
         <th><input type="text" id="edizmd"></th> 
         <th><input type="text" id="idd"></th> 
         <th><input type="text" id="ad"></th> 
         <th><input type="text" id="bd"></th> 
         <th><input type="text" id="en_spard"></th> 
         <th><input type="text" id="spard"></th> 
         <th><input type="text" id="en_periodd"></th> 
         <th><input type="text" id="periodd"></th> 
        </tbody> 
       </table> 
      </form> 
     </div> 
     <div class="modal-footer"> 
      <a href="#" class="btn" data-dismiss="modal">Close</a> 
      <a href="#" class="btn btn-primary">Save changes</a> 
     </div> 
    </div> 

我怎样才能使模式扩展到表的大小,或符合表模态的边界?我试图在bootstrap.css中编辑模态部分,但模态的新位置不在中心。此外,我试图添加类似于class="span4到表内的标签,这似乎什么也没有做。 谢谢。

回答

1

假设模式宽度为600px。要将模态定位在中心,请使用

.modal { left:50%; margin-left:-300px; (它的一半宽度的负值;) }

+0

好的,这似乎是我能做到的最好方法。谢谢。 – tumoxep 2012-08-14 11:44:53