我正在構建一個系統,您可以跟蹤您的任務。 我現在來到一個問題,我希望把這張表的DIV導致溢出.....好吧,沒有問題 - 除了它不溢出horizonitly ...請有人可以幫我PHP表溢出
請有人可以幫我得到這適合....或幫我把這張桌子放在一張桌子上,以適應1100 x 545像素的區域..
我已經得到了一些好看的間距。 ..把它使溢出水平
$UArr = array("u1" => "Introduction to Marketing ",
"u2" => "Maintenance Unit ",
"u3" => "Starting a biz",
"u4" => "Web Design",
"u5" => "Webserver/PHP",
"u6" => "Modeling/Multimedia Design" ,
"u7" => "CISCO 1 " ,
"u8" => "CISCO 2 " ,
"u9" => "C&G Marketing"); ///unit array
$AArr = array("a1" => "Assignment 1", "a2" => "Assignment 2", "a3" => "Assignment 3", "a4" => "Assignment 4"); //assigment array
$TArr = array("t1" => "Task 1", "t2" => "Task 2", "t3" => "Task 3", "t4" => "Task 4"); //task array
$Connection = mysql_connect($host,$username, $password);
mysql_select_db("dbname");
$Result = mysql_query("SELECT * FROM `tracker` WHERE `CollegeID`='collegeid' ");
if(mysql_num_rows($Result) == 1) {
while($Data = mysql_fetch_array($Result)){
$i = 0;
$Assignment = "";
$Unit = "";
$Task = "";
echo "<table style=\"float:left;\" width=\"200\" border=\"0\" overflow:scroll;>";
foreach($Data as $Item => $Value) {
if(!is_numeric($Item) && $Item !== "CollegeID") {
if($i == 0) {
$Unit = substr($Item, 0, 2);
$Assignment = substr($Item, 2, 2);
$Task = substr($Item, 4, 2);
echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$UArr[$Unit]."</p></td></tr>";
echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$AArr[substr($Item, 2, 2)]."</p></td></tr>";
echo "<tr><td width=\"10\">".$TArr[$Task]."</td><td width=\"10\">".DropDown($Item, $Value)."</td></tr>";
}
if($Unit !== substr($Item, 0, 2)) {
echo "</tr>";
echo "</tr>";
echo "<table style=\"float:left;\" width=\"200\" border=\"0\">";
$Unit = substr($Item, 0, 2);
echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$UArr[substr($Item, 0, 2)]."</p></td></tr>";
}
if($Assignment !== substr($Item, 2, 2)) {
$Assignment = substr($Item, 2, 2);
echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$AArr[substr($Item, 2, 2)]."</p></td></tr>";
}
if($Task !== substr($Item, 4, 2)) {
$Task = substr($Item, 4, 2);
echo "<tr><td width=\"10\">".$TArr[$Task]."</td><td width=\"50\">".DropDown($Item, $Value)."</td></tr>";
}
$i++;
}
}
echo "</table>";
我已經將它包含在DIV的CSS中,並且爲了調整大小,我增加了表格的寬度,並在單元標題上使用了大量'
'..現在看起來好吧 – Rsmithy 2012-07-23 12:41:16
Thanx Rsmithy用於接受代碼,我會感謝我今後繼續努力。 – 2012-07-23 12:57:43
即時代碼解決方案發郵件給[email protected] – 2012-07-23 13:13:21