
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
None | size: 1.92 KB | hits: 16 | expires: Never
Grid layout with css?
#outerPanel{
width:100%;
float:right;
position:relative;
}
#rightcol{
width:35%;
float:right;
position:relative;
}
#maincol{
float: left;
position: relative;
width:65%;
}
<p:panel id="outerPanel">
<h:panelGroup id="maincol">
<ui:include src="table1.xhtml" />
</h:panelGroup>
<h:panelGroup id="rightcol">
<ui:include src="input1.xhtml" />
</h:panelGroup>
<h:panelGroup id="maincol">
<ui:include src="table2.xhtml" />
</h:panelGroup>
<h:panelGroup id="rightcol">
<ui:include src="input2.xhtml" />
</h:panelGroup>
</p:panel>
<h:panelGroup styleClass="maincol">
...
</h:panelGroup>
<h:panelGroup styleClass="rightcol">
...
</h:panelGroup>
<h:panelGroup styleClass="maincol">
...
</h:panelGroup>
<h:panelGroup styleClass="rightcol">
...
</h:panelGroup>
.container { width: 100% }
.left { width: 49%; float: left }
.right { width: 49%; float: left }
.clear { clear: both }
<html>
<head>
<title>DIVS</title>
</head>
<body>
<div class="container">
<div class="left">Some Content</div>
<div class="right">Some Content</div>
<div class="clear"></div>
</div>
</body>
</html>
<div class="row">
<h:panelGroup styleClass="maincol">
<ui:include src="table1.xhtml" />
</h:panelGroup>
<h:panelGroup styleClass="rightcol">
<ui:include src="input1.xhtml" />
</h:panelGroup>
</div>
#outerPanel{
width:100%;
float:right;
margin: auto; /*if you want to center out the content*/
/*position:relative;*/ /*what do you want to use relative for?*/
}
.col {
float: left;
clear: both;
}
.rightcol{
width:35%;
float:right;
/*position:relative;*/
}
.maincol{
float: left;
/*position: relative;*/
width:65%;
}