html - Is there a way to render two partial views in C# MVC such that they appear side by side in a single view? -
i new c# mvc , have been utilizing partial views in solution. when render 2 or more partial views in single view, see rendered top bottom (when rendered, appear on page 1 on top of next), expect.
is there way specify partial views rendered instead in side side or grid fashion? ask because there lot of white space , ideal place content of partial views in white space.
example 1
you could wrap partial views in div
elements , set them display: inline-block
, make them appear side side.
css styling:
div.sidebyside { display: inline-block; vertical-align: top; }
view:
<div class="sidebyside">@render.partial(...)</div> <div class="sidebyside">@render.partial(...)</div>
example 2
you could arrange div
s table layout:
css styling:
div.table { display: table; } div.row { display: table-row; } div.cell { display: table-cell; }
view:
<div class="table"> <div class="row"> <div class="cell">@render.partial(...)</div> <div class="cell">@render.partial(...)</div> </div> </div>
Comments
Post a Comment