简体   繁体   English

如何使用bootstrap来对齐angularjs应用程序中的下拉列表?

[英]how to use bootstrap to align dropdown in angularjs application?

I am new to bootstrap and i have no clue as to how to work with it. 我是Bootstrap的新手,我不知道如何使用它。 I have the following code in my HTML.I have compass_twitter_bootstrap in my project. 我的HTML中有以下代码。我的项目中有guide_twitter_bootstrap。

<div class="well">
    <h3>All Adventures</h3>

    <table>
    <tr><td>
    <select name="" id="" ng-model="category" ng-options="c for c in categories">
        <option value="">-- Choose Category --</option>
    </select>
    </td>
    <td><google-places location=location></google-places></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><select name="" id="" ng-model="tMode" ng-options="tM for tM in tModes">
        <option value="">-- Choose Transportation Mode --</option>
    </select></td>
    </tr>
    </table>
    <br/>
    <div ng-model="adventures"></div>
    <div ng-model="foods"></div>
    <div ng-model="arts"></div> 
    <div ng-model="histories"></div>
    <div ng-model="fitness"></div>
    <div ng-model="parks"></div>
    <div ng-model="photos"></div>
    <div ng-model="scavenger"></div>
    <div ng-model="shopping"></div>
    <div ng-model="sightseeing"></div>
    <div ng-model="specialevents"></div>    
    <div ng-model="ghosts"></div>
    <div ng-model="others"></div>
</div>

    <ul class="unstyled">
        <li ng-repeat="tour in tours">
            <div class="well">
                <h4>{{tour.name}}</h4>
                <a href="#/maps"><h5><em>{{tour.author}}</em></h5></a>
                <p>{{tour.category}}</p>
                <p>{{tour.createDate}}</p>
                <p>{{tour.dislikes}}% disliked it</p>
                <p>{{tour.duration}} minutes</p>
                <p>{{tour.likes}}% liked it</p>
                <h5><p>{{tour.stops.name0}}</p></h5>
                <h5><p>{{tour.stops.name1}}</p></h5>
                <h5><p>{{tour.stops.name2}}</p></h5>
                <h5><p>{{tour.stops.name3}}</p></h5>
                <p>{{tour.transportMode}}</p>
            </div>
        </li>
    </ul>

I have two drop down boxes as seen in the attached image. 如所附图片所示,我有两个下拉框。 Can anyone give me suggestion as how how i can use bootstrap and align the dropdown boxes and the input text box in the UI?. 谁能给我建议,说明如何使用引导程序并在UI中对齐下拉框和输入文本框?

在此处输入图片说明

You are using a <table> so if want all the fields to be inline, you need to include all the fields in the same row of the table, like this: 您正在使用<table>因此如果希望所有字段都内联,则需要在表的同一行中包括所有字段,如下所示:

<table>
 <tr>
     <td>
        <select name="" id="" ng-model="category" ng-options="c for c in categories">
           <option value="">-- Choose Category --</option>
        </select>
   </td>
   <td>
     <google-places location=location></google-places>
   </td>
   <td>
     <select name="" id="" ng-model="tMode" ng-options="tM for tM in tModes">
         <option value="">-- Choose Transportation Mode --</option>
     </select>
   </td>
 </tr>
</table>

This the same for any HTML page - it's not directly related to bootstrap nor AngularJS 任何HTML页面都一样-它与bootstrap或AngularJS没有直接关系

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM