2014-01-17 79 views
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年在空間之間是單。我該如何解決這個問題。請做好必要的工作。

+0

的可能重複[爲什麼在HTML多個空格文件在瀏覽器中顯示爲單個空格?](http://stackoverflow.com/questions/433493/why-do-multiple-spaces-in-an-html-file-show-up-as-single-spaces-在瀏覽器中) –

+0

在天數和月份名稱之間,或後者和年份之間有兩個空格是很奇怪的。如果真的需要額外的空間,可以考慮將組件放在不同的單元格中,並根據需要使用填充(在CSS中)。 –

回答

相關問題