0
votes

I tried all ways to centralise a SimplePager in a FlowPanel, then in Grid, in HTMLPanel, DockLayoutPanel, & in <table>, but none of them works, ex:

<g:FlowPanel>
 <g:Grid addStyleNames="style.alignCenter">
   <g:row >
     <g:customCell >
       <c:SimplePager ui:field="mySimplePager" location="CENTER" />     
     </g:customCell>

   </g:row>

 </g:Grid>
</g:FlowPanel>

in Css

.alignCenter{ text-align:center;}

I did try to centralise SimplePager in FlowPanel using code, then it works. Ex:

 FlowPanel myFP=new FlowPanel();
 myFP.getElement().getStyle().setTextAlignment(TextAlign.CENTER);
 myFP.add(mySimplePager);

so, How to Centralise SimplePager within a Grid or FlowPanel (or any panels) in UiBinder?

1

1 Answers

0
votes

In custom cell can you try with this?

            <table style="width:100%">
                <tr>
                    <td align='center'>
                        <c:SimplePager ui:field='mySimplePager' />
                    </td>
                </tr>
            </table>

Or simpler replacing a flowpanel with an htmlpanel:

        <g:HTMLPanel>
            <table style="width:100%">
                <tr>
                    <td align='center'>
                        <c:SimplePager ui:field='mySimplePager' />
                    </td>
                </tr>
            </table>
        </g:HTMLPanel>