Search code examples
cssgrailsalignmentgsp

How to align elements in a section in gsp while using grails


I am trying to display an image on the right of an already existing table in gsp.

Below is my code.

<body>
    <section>
            <div id=“image”></div>
            <section>
            <q:search/>
            <div class="table-responsive">
                <table class="table table-striped">
                </table>
            </div>
            </section>
      </section>
</body>

Right now the image div is on top of the table. I need it to be to the right of the table always. How can I do that?.

Finally it works, I did it like this. Is there a better way?.

<div style="clear:both; width:100%">

     <div style="margin-bottom: 30px;float:left;width:50%;">

     </div>

     <div style="float:left;max-width:30%;max-height:20%;margin-bottom:30px" >

     </div>
</div>

Solution

  • I did it like this. Is there a better way?.

    <div style="clear:both; width:100%">
    
         <div style="margin-bottom: 30px;float:left;width:50%;">
    
         </div>
    
         <div style="float:left;max-width:30%;max-height:20%;margin-bottom:30px" >
    
         </div>
    </div>