gpt4 book ai didi

java - 右对齐属性在为 tds 提供宽度时不起作用

转载 作者:行者123 更新时间:2023-11-28 15:02:52 25 4
gpt4 key购买 nike

我有一个 jsp 和一些 jspf,我希望其中的短期、长期字段以及标题右对齐,但是一旦我删除宽度属性,它就无法工作从我的样式右对齐开始工作。尽管样式在其中一种中有效jsp,但无法使用包含所有其他 jspf 和一个 jsp 的 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 中,包括所有其他的,也不在包含的 jspfs 中。

风格是

.termValues{
width: 6em;
text-align: right;
}

最佳答案

尝试将表格布局设置为固定布局。这通常可以解决我遇到的列未排列的任何问题。

table
{
table-layout:fixed;
}

关于java - 右对齐属性在为 tds 提供宽度时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1388781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com