2015-10-16 16 views
0

我有這樣的HTML行:如何在一行中製作HTML元素?

<table class="table table-responsive table-hover"> 
    <thead> 
     <tr> 
      <th>Type Object</th> 
      <th style="width: 100px;text-align: left"> 
       <a class="btn btn-primary btn-sm"> 
        <i class="glyphicon glyphicon-plus"></i> 
       </a> 
      </th> 
     </tr> 
    </thead> 
    <tbody ng-repeat="object in objects track by object.Id"> 
     <tr> 
      <td ng-bind="object.Name"></td> 
      <td> 
       <a class="btn btn-default btn-xs" ng-click="object.showPhoto = !object.showPhoto; $event.stopPropagation();"><i class="glyphicon glyphicon-camera"></i></a> 
       <a class="btn btn-default btn-xs" ui-sref="objects.view({regionId:region.Id, objectId:object.Id})" ng-click="$event.stopPropagation();"><i class="glyphicon glyphicon-info-sign"></i></a> 
       <a class="btn btn-default btn-xs" ng-click="zoomObject(object); $event.stopPropagation();"><i class="glyphicon glyphicon-screenshot"></i></a> 
       <a class="btn btn-default btn-xs" ng-click="object.showReview = object.showReview;"><i class="glyphicon glyphicon-list-alt"></i></a> 
      </td> 
     </tr> 
     <tr ng-if="object.showPhoto"> 
      <td colspan="2"><img ng-src="{{getPhotoUrl(object)}}" style="max-width: 100%;" alt="Image Object" /></td> 
     </tr> 
     <tr ng-if="object.showReview"> 
      <td colspan="2">nnn!!!</td> 
      <list-of-insp></list-of-insp> 
     </tr> 
    </tbody> 
</table> 

這是如何的長相鑑於:

enter image description here

我的問題是如何讓所有元素在一排?

+0

你嘗試在下面的代碼行增加寬度在第一列中的至少大小的最小寬度將它們包裝在一個元件/格? '' –

回答

2
<th style="width: 100px;text-align: left"> 

將其更改爲200px之類的東西。

第二件事 - 你的表沒有響應,在Bootstrap中你必須在類的表響應中在表的上方創建另一個div。

+1

很好的答案。 :) – CodeLyfe

1

浮法左每個元素,並與所有4個元件