代码之家  ›  专栏  ›  技术社区  ›  Abhi

为TDS提供宽度时右对齐属性不起作用

  •  0
  • Abhi  · 技术社区  · 16 年前

    我有一个jsp和一些jspf,在其中我希望短期、长期、中期字段以及标题是右对齐的,但是一旦删除width属性,它就不能工作了 从我的样式右对齐开始工作。 jsp,但不工作jsp,它包括所有其他jspf和jsp。

    包含其他jspf和jsp的jsp类似于——-

    <html>
    <head>
    <script>
    </script> 
    </head>
    <body class="dashboard">
    <html-el:form action="${form.formAction}">
    <div id="scrollHeader">     
        <html-el:hidden property="selectedForecastUnitOID"/>    
        <html-el:hidden property="selectedFactoryOID"/> 
            <%@ include file="ViewInputHeader.jspf"%>     
            <%@ include file="Error.jspf"%>
    </div>
    <div id="scrollBody">
    <!-- **** BEGIN MESSAGE AREA **** -->
    <table border="0" cellspacing="0" cellpadding="0">
    </table>
    <!-- NOTE: expand/collapse functionality needs to be added to this screen. Tables were used to allow the columns to align.
        This may not be the best approach for the actual implementation.
     -->
    <table class="dashboard">
        <COLGROUP class="dashRowLabel" span="1" />
        <COLGROUP class="dashStep1" span="1" />
        <COLGROUP class="dashStep2" span="3" />
        <COLGROUP class="dashStep3" span="4" />
        <COLGROUP class="dashStep4" span="4" />
        <COLGROUP class="dashStep5" span="1" />
        <thead>
            <tr class="stepRow">
                <th>&nbsp;</th>
                <th>${PAGE_TRANSLATION_KEYS['STEP1']}</th>
                <th colspan="3">${PAGE_TRANSLATION_KEYS['STEP2']}</th>
                <th colspan="4">${PAGE_TRANSLATION_KEYS['STEP3']}</th>          
            </tr>
            <TR class="stepLabel">
        <th rowspan=2 class="headerLineName"></th> 
        <th rowspan=2class="stepOne">${PAGE_TRANSLATION_KEYS'ABBR_COE']}</th>
        <th rowspan=2 class="stepTwo">${PAGE_TRANSLATION_KEYS['ABBR_MKT']}</th>
        <th rowspan=2 class="stepTwo">${PAGE_TRANSLATION_KEYS['ABBR_PDC']}</th>
        <th rowspan=2 class="stepTwo">${PAGE_TRANSLATION_KEYS['ABBR_SPO']}</th>
        <th rowspan=2 class="stepOne">${PAGE_TRANSLATION_KEYS['MEETING']}</th>
        <th colspan="3" class="spanLabel">${PAGE_TRANSLATION_KEYS['COMPOSITE_ADJ']}</th>            
            </TR>
            <TR class="stepLabel numeric">
            <th class="termValues">${PAGE_TRANSLATION_KEYS['TERM_SHORT']}</th>
            <th class="termValues">${PAGE_TRANSLATION_KEYS['TERM_MID']}</th>
            <th class="termValues">${PAGE_TRANSLATION_KEYS['TERM_LONG']}</th>           
            </TR>
        </thead>
    </table> 
    
    <c:forEach items="${form.sbus}" var="sbu" varStatus="id">
            <DIV class=section>
            <DIV class="title collapsable" id="SBU${sbu.sbuOID}"> ${sbu.sbuName}
                <%@ include file="SbuSummaryIndicators.jspf"%>      
            </DIV>
            <DIV class="content positioning">
        <c:forEach items="${sbu.forecastUnits}" var="forecastUnit" varStatus="forecastid">
                <DIV class=section>
                    <DIV class="title collapsable" id="FU${forecastUnit.forecastUnitOID}">${forecastUnit.forecastUnitID}
                    <%@ include file="ForecastUnitSummaryIndicators.jspf"%>
                    </DIV>
                    <DIV class="content factoryPositioning">
        <c:forEach items="${forecastUnit.factories}" var="factory" varStatus="factoryid">
                            <DIV class=section>
                                <DIV class="title collapsed expandableFactory ajaxExpand" id="DR${forecastUnit.forecastUnitOID}_${factory.factoryOID}">(${factory.factoryID}) ${factory.factoryName}
                <%@ include file="FactorySummaryIndicators.jspf"%>                      
                </DIV>
                  <DIV class="content">
                </DIV>  
            </DIV>                      
            </c:forEach>
            </DIV>
            </DIV>
            </c:forEach>
            </DIV>
            </DIV>
    </c:forEach>
    
    </div>
    
    </html-el:form>
    </body>
    </html-el:html>
    

    其中一个包含的jspf如下---

    <table> 
        <COLGROUP class="dashRowLabel" span="1" />
        <COLGROUP class="dashStep1" span="1" />
        <COLGROUP class="dashStep2" span="3" />
        <COLGROUP class="dashStep3" span="4" />
        <COLGROUP class="dashStep4" span="4" />
        <COLGROUP class="dashStep5" span="1" />
    
        <tr class="dashProductLine">
            <td class="productLineName"><html-el:text property="form.sbus[${id.count}].sbuName" styleClass="textSize textColor" readonly="true" value=" "/></td>
    
            <c:if test="${sbu.sbuSummary.demandPlanning=='0'}">
                <td class="statusWaiting stepOne"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.demandPlanning=='1'}">
                <td class="statusNotStarted stepOne"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.demandPlanning=='2'}">
                <td class="statusStarted stepOne"></td>
            </c:if>
    <c:if test="${sbu.sbuSummary.demandPlanning=='3' || compositeProcessStatus.demandPlanning=='5'}">
            <td class="statusCompleted stepOne"></td>
            </c:if>
    
            <c:if test="${sbu.sbuSummary.marketing=='0'}">
                <td class="statusWaiting stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.marketing=='1'}">
                <td class="statusNotStarted stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.marketing=='2'}">
                <td class="statusStarted stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.marketing=='3' || sbu.sbuSummary.marketing=='5'}">
                <td class="statusCompleted stepTwo"></td>
            </c:if>
    
            <c:if test="${sbu.sbuSummary.analyst=='0'}">
                <td class="statusWaiting stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.analyst=='1'}">
                <td class="statusNotStarted stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.analyst=='2'}">
                <td class="statusStarted stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.analyst=='3' || sbu.sbuSummary.analyst=='5'}">
                <td class="statusCompleted stepTwo"></td>
            </c:if>
    
            <c:if test="${sbu.sbuSummary.spo=='0'}">
                <td class="statusWaiting stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.spo=='1'}">
                <td class="statusNotStarted stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.spo=='2'}">
                <td class="statusStarted stepTwo"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.spo=='3' || sbu.sbuSummary.spo=='5'}">
                <td class="statusCompleted stepTwo"></td>
            </c:if>
    
            <c:if test="${sbu.sbuSummary.meeting=='0'}">
                <td class="statusWaiting stepOne"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.meeting=='1'}">
                <td class="statusNotStarted stepOne"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.meeting=='2'}">
                <td class="statusStarted stepOne"></td>
            </c:if>
            <c:if test="${sbu.sbuSummary.meeting=='3' || sbu.sbuSummary.meeting=='5'}">
                <td class="statusCompleted stepOne"></td>
            </c:if>
    
            <TD class="numeric termValues"><c:if test="${sbu.sbuSummary.shortCompositeAmount != '0'}" >${sbu.sbuSummary.shortCompositeAmount}</c:if></TD>
            <TD class="numeric termValues"><c:if test="${sbu.sbuSummary.midCompositeAmount != '0'}" >${sbu.sbuSummary.midCompositeAmount}</c:if></TD>
            <TD class="numeric termValues"><c:if test="${sbu.sbuSummary.longCompositeAmount != '0'}" >${sbu.sbuSummary.longCompositeAmount}</c:if></TD>
        </tr>
    </table>
    

    尽管它工作的jsp类似于----

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
    <%response.setHeader("Pragma", "No-cache");response.setHeader("Cache-Control", "no-cache");response.setDateHeader("Expires", 0);%>
    <link rel="stylesheet" href="css/pages/dashboard.css" type="text/css">
    <%@ include file="Error.jspf"%> 
    <table class="dashboard">
        <c:forEach items="${viewDashboardForm.compositeProcessStatusList}" var="compositeProcessStatus">
            <tr class="dashProductLine">
                        <td class="name viewDashboard">${compositeProcessStatus.productLineName}</td>
    
                <c:if test="${compositeProcessStatus.demandPlanning=='0'}">
                    <td class="statusWaiting stepOne"></td>
                        </c:if>
                <c:if test="${compositeProcessStatus.demandPlanning=='1'}">
                <td class="statusNotStarted stepOne"></td>
                        </c:if>
                <c:if test="${compositeProcessStatus.demandPlanning=='2'}">
                <td class="statusStarted stepOne"></td>
                        </c:if>
                <c:if test="${compositeProcessStatus.demandPlanning=='3' ||  compositeProcessStatus.demandPlanning=='5'}">
                <td class="statusCompleted stepOne"></td>
                </c:if>
    
                <c:if test="${compositeProcessStatus.marketing=='0'}">
                <td class="statusWaiting stepTwo"></td>
                        </c:if>
                <c:if test="${compositeProcessStatus.marketing=='1'}">
                <td class="statusNotStarted stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.marketing=='2'}">
                <td class="statusStarted stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.marketing=='3' || compositeProcessStatus.marketing=='5'}">
                <td class="statusCompleted stepTwo"></td>
                </c:if>
    
                <c:if test="${compositeProcessStatus.analyst=='0'}">
                <td class="statusWaiting stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.analyst=='1'}">
                <td class="statusNotStarted stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.analyst=='2'}">
                <td class="statusStarted stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.analyst=='3' || compositeProcessStatus.analyst=='5'}">
                <td class="statusCompleted stepTwo"></td>
                </c:if>
    
                <c:if test="${compositeProcessStatus.spo=='0'}">
                <td class="statusWaiting stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.spo=='1'}">
                <td class="statusNotStarted stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.spo=='2'}">
                <td class="statusStarted stepTwo"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.spo=='3' || compositeProcessStatus.spo=='5'}">
                <td class="statusCompleted stepTwo"></td>
                </c:if>
    
                <c:if test="${compositeProcessStatus.meeting=='0'}">
                <td class="statusWaiting stepOne"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.meeting=='1'}">
                <td class="statusNotStarted stepOne"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.meeting=='2'}">
                <td class="statusStarted stepOne"></td>
                </c:if>
                <c:if test="${compositeProcessStatus.meeting=='3' || compositeProcessStatus.meeting=='5'}">
                <td class="statusCompleted stepOne"></td>
                </c:if>
    
                <TD class="numeric termValues"><c:if test="${compositeProcessStatus.shortCompositeAmount != '0'}" >${compositeProcessStatus.shortCompositeAmount}</c:if></TD>
                <TD class="numeric termValues"><c:if test="${compositeProcessStatus.midCompositeAmount != '0'}" >${compositeProcessStatus.midCompositeAmount}</c:if></TD>
                    <TD class="numeric termValues"><c:if test="${compositeProcessStatus.longCompositeAmount != '0'}" >${compositeProcessStatus.longCompositeAmount}</c:if></TD>             
            </tr>
        </c:forEach>
    </table>
    

    不应用的样式是应用于头字段的termvalues 在包含其他文件和包含的文件的jsp中,它在 包括jsp,但不在jsp中,包括所有其他jspf,也不在包括的jspfs中。

    风格是

    .termValues{
        width: 6em;
        text-align: right;
    }
    
    1 回复  |  直到 16 年前
        1
  •  0
  •   Anthony    16 年前

    尝试将表布局设置为“已修复”。这通常可以解决我遇到的列没有排列的问题。

    table
    {
         table-layout:fixed;
    }