0

I am using jsf2 with primefaces.

 h:selectOneRadio
               f:selectItems 
h:selectOneRadio

This produces a radio button and the input label inside the same td such as

<td>
   <input type=radio> </input>
   label 
</td>

My problem is I need to add space between the radio button and the label. (X)C121 Active (X)LRM

In the above radio button list I need to add space such as

(x)    <---Space-->  C121 Active
(x)    <--Space -->  LRM

What is the best way I can add space for this ? Need help. Sorry as I am new for JSF I could not figure-out a solution. P.S (x) represents a radio button Radio button and the label

Tech Stack : JSF 2.0, Spring 3.x , Hibernate 4.x.

  • 1
    This is just basic HTML/CSS. Whilst JSF experts can answer it, it's technically better to reframe the question with a plain HTML/CSS snippet and retarget it at `[html][css]` users. Once you got the answer, then it's just a matter of figuring how to write JSF code in such way that it generates the desired HTML/CSS output. – BalusC Apr 07 '15 at 15:29
  • Thanks, yet I am bit new to JSF. Basically if I can get this done by CSS would take that, yet my intention was to know whether there are attributes within the jsf tags to get this done. – Rashendra - Rashen Apr 07 '15 at 15:33
  • 1
    HTML styling is supposed to be done by CSS, yes. Start at `` tag documentation to learn about the available attributes to declare CSS style classes which should end up in the generated HTML output. – BalusC Apr 07 '15 at 15:36
  • BalusC your point was spot on table.radio_select input { font-size: 100%; margin-left: 120px; margin-right: 120px; } – Rashendra - Rashen Apr 07 '15 at 17:12

1 Answers1

1

I think some styling like this would be appropriate:

input[type=radio]{
    margin-right: 7px;
}

Put it in <style>-tag in h:head or better yet in an external css-file you include with h:outputStylesheet.

This way, you'll target them all without further code.

Jaqen H'ghar
  • 4,305
  • 2
  • 14
  • 26