0
嗨,我已经创建了包含表格的jsp页面。表格单元格值使用jstl动态加载。在表格单元格中包含日期。日期,月份和年份之间的间隔是两个间隔。但tabel单元格仅显示单个空间。我的示例代码显示在下面,请解决我的问题。对不起,我的英语不好。提前致谢。html表格单元格允许单个空间在日期之间
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Precision Attendance</title>
</head>
<body>
<%
ArrayList list = new ArrayList();
Map empDetails = new HashMap();
empDetails.put("EmployeeID", "1");
empDetails.put("EmployeeCode","PB131");
empDetails.put("EmployeeName","Balaji");
empDetails.put("DOJ","17 January 2014");
list.add(empDetails);
request.setAttribute("empDetailsList", list);
%>
<table cellpadding="5px" cellspacing="5px" class="TableGrid"
id="dgEmpShiftDetails">
<tr>
<th>Employee ID</th>
<th>Employee Code</th>
<th>Employee Name</th>
<th>DOJ</th>
</tr>
<c:forEach items="${empDetailsList}" var="empDetLst">
<tr>
<td><c:out value="${empDetLst.EmployeeID}" /></td>
<td><c:out value="${empDetLst.EmployeeCode}" /></td>
<td><c:out value="${empDetLst.EmployeeName}" /></td>
<td><c:out value="${empDetLst.DOJ}" /></td>
</tr>
</c:forEach>
</table>
</body>
</html>
我2014年1月设置DOJ如17,但表单元格显示了该像1月17日2014年在空间之间是单。我该如何解决这个问题。请做好必要的工作。
的可能重复[为什么在HTML多个空格文件在浏览器中显示为单个空格?](http://stackoverflow.com/questions/433493/why-do-multiple-spaces-in-an-html-file-show-up-as-single-spaces-在浏览器中) –
在天数和月份名称之间,或后者和年份之间有两个空格是很奇怪的。如果真的需要额外的空间,可以考虑将组件放在不同的单元格中,并根据需要使用填充(在CSS中)。 –