【问题标题】:HTML indent tableHTML缩进表
【发布时间】:2014-05-30 08:04:29
【问题描述】:
    <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 也可以。感谢您的帮助!

【问题讨论】:

  • 这看起来像是 ordered list 的工作,而不是表格。
  • 嵌套有序列表,不少于;它绝对类似于一些非表格信息。
  • @DavidThomas 是的,你是对的,嵌套有序列表是要走的路
  • 是的,表格是很棘手的事情,对于某些事情来说非常方便,例如在页面上仅使用 css 将某些东西居中。但是对于其他事情,比如你想要的,你最好使用上面建议的其他东西。你不能缩进表格的一部分;表格始终是由行和单元格组成的网格。另一件事是表格总是缩放以适应其中的内容。方便如前所述的居中,但如果您正在寻找像标签这样的自定义布局..
  • 好的,谢谢大家!我猜桌子不是这样的:P。谢谢!!!

标签: html css jsf


【解决方案1】:

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

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

【讨论】:

  • 很高兴能帮上忙!祝你好运!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-09
  • 2012-03-17
  • 2013-07-31
  • 2012-03-03
  • 1970-01-01
相关资源
最近更新 更多