1

So I have a table, and I'm looking to have and inline SelectRadio. The Issue is that it is being pushed to the next line. I've tried a few things, but haven't been able to figure it out. Any pointers?

See Pic: I want the radio buttons to go to the right of "TD TEXT". The radio buttons are instead put into the next line TD, with colspan 2.

enter image description here

    .threeColumnGrid > .cell{
        display: inline-block;
        width:33%;
        vertical-align: text-top;
        height:100%;
        }
    .left{
        text-align:left;
    }
    .right{
        text-align:right;
    }

<div class="cell" >
    <table >
           <tr>
              <td class="right"> TD TEXT: </td>
                 <td > 
                     <apex:selectRadio id="Radio" value="{!values}" >
                         <apex:selectOptions value="{!options}"/>
                     </apex:selectRadio>
                 </td>
             </tr>
     </table>
</div>

Here is the inspect element. I can see the issue, I just don't know enough to fix it. Help?

enter image description here

1 Answer 1

1

OK, so as I went along many, many wrong paths... the answer is: shove it all in a panel grid, inside the TR, and give it some columns. Adjust the margins to move it for perfect alignment.

<tr>
      <apex:panelgrid columns="2" style="float:right;">
                  <apex:outputtext value="TEXT:"/>
                    <apex:selectRadio id="pmRadio" value="{!tempwrap.options}" style="margin-top:-8px;" >
                        <apex:selectOptions value="{!Options}"/>
                    </apex:selectRadio>

           <apex:outputtext value="TEXT:"/>
                    <apex:selectRadio id="ppRadio" value="{!tempwrap.options}" style="margin-top:-7px;" >
                        <apex:selectOptions value="{!recOptions}"/>
                    </apex:selectRadio>
 </apex:panelgrid>
     </tr>

UPDATE: So this doesn't work for apex:inputcheckbox... still throws it to another line, but works fine for selectRadio? Anyway, I guess with playing around it can be made to work.

2
  • Perhaps you might get more consistent results if you also give them the style display: inline-block Sep 10, 2015 at 14:28
  • I tried but it didn't really do anything - but I'll take your advice and start putting that into the CSS, so hopefully I don't run into any issues next time. Thanks!
    – RC82
    Sep 10, 2015 at 19:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .