Expand column inside Bootstrap css grid shifts other columns

只愿长相守 提交于 2019-12-11 07:18:05

问题


I have a bootstrap grid that contain an expand component.

My actual problem is that when I expand one column, the other columns get shifted because they are in the same row.

I would like to know How can I make column independs each one to another

expand component

<p>
  <button type="button" class="btn btn-outline-primary" (click)="isCollapsed = !isCollapsed"
          [attr.aria-expanded]="!isCollapsed" aria-controls="collapseExample">
    Toggle
  </button>
</p>
<div id="collapseExample" [ngbCollapse]="isCollapsed">
  <div >
    <div class="">
      You can collapse this card by clicking Toggle
    </div>
  </div>
</div>

app component ( container )

<div class="row">
  <div *ngFor="let card of cards; let index=index" class="col-4 col-sm-4 col-xl-4">
    <app-expend></app-expend>
  </div>
</div>

Here's what I would like to do

Here's what I expect

Here's an example to illustrate my actual problem


回答1:


Is accordion what you need? Check this example, https://getbootstrap.com/docs/4.0/components/collapse/#accordion-example



来源:https://stackoverflow.com/questions/55007478/expand-column-inside-bootstrap-css-grid-shifts-other-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!