Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Align the first div on the same height with the second div, the first div should be placed closest to the left and the second closeste to the right

In the container div I need to have the two sub divs placed at the same height. The first div (Total elements) should be anchored closest to the left of the page and the second div (The button) closest to the right.

<div class="p-grid p-dir-col">

    <div class="p-col">

        <div class="p-grid p-justify-between">

            Test

        </div>

    </div>

</div>
**<div class="container">**

<div *ngIf="searchLaunched" class="left-div" style="padding: 0.5em; font-size: 1.25em;">

    {{ totalElements }} élément<span *ngIf="totalElements > 1">s</span> trouvé<span *ngIf="totalElements > 1">s</span>

</div>

<div *ngIf="canCreate" class="p-grid p-justify-end p-nogutter btn-table-crud-top" style="margin-top: 0.5em;">

    <p-button (click)="addUser()" label="Créer utilisateur" title="{{ tooltips.creer }}"></p-button>

</div>

</div>
</div>

</div>
<p-table>
Test
</p-table>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Use Flexbox with justify-content: space-between

div.container {
  display: flex;
  justify-content: space-between;
}
<div class="container">

  <div>
    totalElements
  </div>

  <div>
    <button>create user</button>
  </div>

</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading