0
I am creating a commercial project in JSF, and to start the project I started to create the layout of the pages, to create the project, I am doing it by pieces, and in each piece of the project I am creating small projects that will be part of a single project.
The part I wanted to talk about is the page that will display the products.
I would like you to look carefully at the code line below;
<table>
<ui:repeat var="produto" value="#{pesquisaProdutoBean.produtosListados}" varStatus="status">
<tr>
<td> <h:graphicImage library="images" name="relogio.jpeg"/> </td>
<td> descrição do relogio </td>
<td> valor do relogio </td>
</tr>
</ui:repeat>
</table>
She’s getting like this;
You can see that there is a first column that contains the image and another second column that contains the description, all JSF pages with tables are the same.
Look at this other example;
Already in this example things are very different, the image is in one line, the description is in another line and the values in another line.
While in the first image items are organized in columns, in the second image they are organized in rows.
I wish I could organize my table in rows and not columns, I have made some attempts but I have not succeeded. I need to know how to do this.
I put my XHTML like this;
<h:form>
<table>
<ui:repeat var="produto"
value="#{pesquisaProdutoBean.produtosListados}"
varStatus="status">
<div class="row">
<div class="col-md-4">
<h:graphicImage library="images" name="relogio.jpeg"
id="imagemProduto" />
</div>
<div class="col-md-4">
<div id="descProduto">RELÓGIO FOSSIL FCH2784N</div>
</div>
<div class="col-md-4">
<div id="descValor">R$ 500,00</div>
</div>
</div>
</ui:repeat>
</table>
</h:form>
CSS:
#descProduto{
position:relative;
margin-top:50px;
text-align: left;
}
#descValor{
position:relative;
margin-top:50px;
font-size:18px;
text-align: left;
font-style: italic;
}
When it wasn’t what I wanted;
@Viniciusdutra Do not add comments as an issue to the question. If you have a question or need clarification from the author, use this comment section, because that’s what it’s for.
– Chun
sorry I didn’t get the comment.
– wladyband
the comment was for Vinicius, who had made an issue to his question with the comment: I’m interested in helping you, but I’m having a hard time understanding your doubt. It would be possible to make more clear what you currently have and where you want to get?
– Chun
explaining in a practical way I wanted to know how to configure the css to look like in the second figure. take a look that I just updated my post.
– wladyband
@Chun I think he didn’t comment because he doesn’t have enough reputation to comment. p
– DiegoAugusto
True. But I already transcribed what he had added as an edit, for comment :)
– Chun
@wladyband you are using bootstrap?
– DiegoAugusto
I’m using yes.
– wladyband
Have you tried to take the
<div class="col-md-4">
the description and value?– DiegoAugusto