How to align items in a to the right

前端 未结 3 1389
萌比男神i
萌比男神i 2020-12-01 17:03

How would I align everything in my below to the far right?

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 17:26

    The renders a HTML table. You basically want to apply text-align: right; on every element it renders. With the current code, easiest would be to apply the following:

    #authenticate table td {
        text-align: right;
    }
    

    You can of course also be more specific, e.g. giving the its own styleClass and defining a rule in CSS (which would be applied directly on the rendered HTML

    element).

    
    

    with

    .className td {
        text-align: right;
    }
    

    You can also give each

    element its own class by columnClasses attribute which accepts a commaseparated string of CSS classnames which are to be applied repeatedly on the elements. If you want to apply the same class on every element, just specify it once:

    
    

    with

    .className {
        text-align: right;
    }
    

    As an extra hint: rightclick the webpage in webbrowser and choose View Source, then you'll understand better what JSF is all exactly generating.

    提交回复
    热议问题