如何在使用 grails 时对齐 gsp 中的一个部分中的元素

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

我正在尝试在 gsp 中已存在的 table 右侧显示图像。

下面是我的代码。

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

现在图像 div 位于 table 之上。我需要它始终位于 table 的右侧。我该怎么做?

终于成功了,我是这样弄的。有没有更好的办法?

<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>

我是这样做的。有没有更好的办法?

<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>