HTML缩进表

时间:2014-05-29 18:04:37

标签: html css jsf

    <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也没关系。谢谢你的帮助!

1 个答案:

答案 0 :(得分:2)

您可能想要将其标记为如此。我同意表格可能不是这个问题的最佳解决方案。

<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>