<table class="layout-table">
    <tr>
        <td><strong>3. Has the person completed all required training within the past three years?</strong><br/><br/></td>
    </tr>
    <tr>
        <td><strong>a. Copy of It</strong>
            <p:selectOneRadio id="radio3" value="#{question3a}">
                <f:selectItem itemLabel="Yes" itemValue="0" />&#160;&#160;&#160;
                <f:selectItem itemLabel="No" itemValue="1" />&#160;&#160;&#160;
                <f:selectItem itemLabel="NA" itemValue="2" />&#160;&#160;&#160;
            </p:selectOneRadio>
            <br/>
            <h:outputText id="counter3" />
        </td>
    </tr>
  </table>


我想做的就是让桌子看起来像这样

   3. Has the person completed all required training within the past three years?
          a. Copy of It     Yes []     No[]    NA[]
          b. (another one)  Yes []     No[]    NA[]


我不知道如何制表a和b,而且如果我将其制作在列右侧按钮的位置,那么它会一直将其一直排到最右边,而我不确定为什么。这可能没有CSS吗?如果没有,那么CSS也可以。谢谢您的帮助!

最佳答案

您可能需要对其进行标记,使其看起来像这样。我同意表可能不是解决此问题的最佳方法。

<table class="layout-table">
   <tr>
      <td><strong>3. Has the person completed all required training within the past three years?</strong>
   </tr>
   <tr>
      <td>
         <table width="600" cellpadding="0" cellspacing="0" border="0" style="margin: 0 auto;">
            <tr>
               <td>
                  <p:selectOneRadio id="radio3" value="#{question3a}">
                     <f:selectItem itemLabel="Yes" itemValue="0" />&#160;&#160;&#160;
                     <f:selectItem itemLabel="No" itemValue="1" />&#160;&#160;&#160;
                     <f:selectItem itemLabel="NA" itemValue="2" />&#160;&#160;&#160;
                  </p:selectOneRadio>
               </td>
            </tr>
            <tr>
               <td>
                  <p:selectOneRadio id="radio3" value="#{question3a}">
                     <f:selectItem itemLabel="Yes" itemValue="0" />&#160;&#160;&#160;
                     <f:selectItem itemLabel="No" itemValue="1" />&#160;&#160;&#160;
                     <f:selectItem itemLabel="NA" itemValue="2" />&#160;&#160;&#160;
                  </p:selectOneRadio>
               </td>
            </tr>
         </table>
      </td>
   </tr>
</table>

关于html - HTML缩进表,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23939965/

10-12 14:54