Problems setting up Table with CSS

0

I'm 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'm doing it in pieces, and in each piece of the project I'm creating small projects that will be part of a single project.

The part that I wanted to stop is the page that will display the products.

I would like you to look closely at the line of code 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>

It's getting like this;

Youcanseethatthereisafirstcolumnthatcontainstheimageandanothersecondcolumnthatcontainsthedescription,allpagesinJSFwithtablesarethesame.

Lookatthisotherexample;

Inthisexample,thingsareverydifferent,theimagesareinoneline,thedescriptionisinanotherlineandthevaluesinanotherline.

Whileinthefirstimagetheitemsarearrangedincolumns,inthesecondimagetheyarearrangedinlines.Iwantedtobeabletoorganizemytableinrowsandnotcolumns,IhavemadesomeattemptsbutIdidnotsucceed.Ineedtoknowhowtodothis.

IputmyXHTMLlikethis;

<h:form><table><ui:repeatvar="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;
}

Being that it was not what I wanted;

    
asked by anonymous 08.12.2015 / 14:59

1 answer

1

I tested it with HTML+Bootstrap+AngularJS and it worked, I think it will also work on JSF , try doing this:

<h:form>
   <table>
      <div class="row">
         <ui:repeat var="produto"
            value="#{pesquisaProdutoBean.produtosListados}"
            varStatus="status">
            <div class="col-md-4">
               <h:graphicImage library="images" name="relogio.jpeg"
                  id="imagemProduto" />
            </div>
            </br>
            <div id="descProduto">RELÓGIO FOSSIL FCH2784N</div>
            </br>
            <div id="descValor">R$ 500,00</div>
         </ui:repeat>
      </div>
   </table>
</h:form>

Here's the example: link

Just increase the size of the result window so you will see one image next to the other.

    
09.12.2015 / 20:44