做一個項目的時候,從數據庫獲取數據,用迭代的方式在前台顯示,只能顯示一部分的信息,就好像是有一個固定空間似的,只要內容超出了這個空間,就不能顯示了,怎麼解決?
代碼如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>開始答題</title>
<script type="text/javascript">
var ksTime; //定義考試時間以分鐘計算
ksTime = 120;//設置時間 這裡設置為0.1代表是6秒,測試用
if (readCookie("ss") == "") {
setCookie("ss", new Date(), ksTime / 60);
}
function sT() {
var tti = new Date();
var lt = parseInt((tti - new Date(readCookie("ss"))) / 1000)
if ((ksTime * 60 - lt) < 0) {
setCookie("ss", new Date(), 0);
alert("考試時間到!\n即將提交試卷!");
document.forms[0].submit();
} else {
lm = Math.floor(lt / 60);
ls = lt % 60;
allY = ksTime * 60 - lt;
ym = Math.floor(allY / 60);
ys = allY % 60;
document.getElementById("tTime").innerHTML = "考試已經開始了" + lm + "分"
+ ls + "秒" + ",剩余" + ym + "分" + ys + "秒";
var ttt = setTimeout("sT()", 1000);
}
}
function readCookie(name) {
var cookieValue = "";
var search = name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
cookieValue = document.cookie.substring(offset, end)
}
}
return cookieValue;
}
function setCookie(name, value, hours) {
var expire = "";
if (hours != null) {
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + value + expire;
}
</script>
</head>
<body onload="sT()">
<form action="submitExam" method="post">
<table align="center" bgcolor="#0066cc" width="66%">
<tr>
<td align="left">考試
最佳回答:
看代碼看頭疼……可能是容器大小問題……把字體設置小一點看看……