[請益] 表格不管怎麼排都會亂掉
我用php+mysql,列出一個表格
有用substr來把字串縮短
結果不管怎麼排,還是亂七八糟
有很多欄的最後一欄不見,然後跟前面一欄連在一起
部分程式:
$colorStr=substr($colorStr,0,200);
<table border=1 >
<td width=50 >編號</td>
<td width=200>標題</td>
<td width=700>內容</td>
</table>
<table border=1>
<td
{width:100px;height=50;overflow:hidden;white-space:nowrap;}>{$cont[no]}</td>
<td {width:200px;height=50;overflow:hidden;white-space:nowrap;}>$cont[title]
</td>
<td {width:700px;height=100;overflow:hidden;white-space:nowrap;}>$colorStr</td>
<td width=100>詳細內容</a></td>
</table>"
應該是很正常,可是資料不知道為什麼會亂掉,也許是資料量很大會亂,但有些一樣很多
也是不亂…
附圖:http://www.pixnet.net/photo/yo0401/57479977
有點小,不過應該可以看到到,有幾欄都縮在一起了,有的也可以正常顯示
當改變顯示的文字的多少時,也會改變,顯示愈少,比較少錯誤(但還是有)
用html排版也是常常都沒辦法對的很齊
這種情形要怎麼克服呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.164.196
推
07/05 21:45, , 1F
07/05 21:45, 1F
→
07/05 21:49, , 2F
07/05 21:49, 2F
推
07/06 20:37, , 3F
07/06 20:37, 3F
推
07/07 13:13, , 4F
07/07 13:13, 4F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章