如题,做了个网站,表格 ,行 ,显示内容,由于内容长短不一。长的话,就换行了。显得不整洁。
------解决方案--------------------
支持IE与FF。未测试opera 与其它浏览器。请自测
- HTML code
<html> <head><title>让表格里的数据按宽度显示,并多出的部分隐藏用...</title> <style type="text/css"> table { border-collapse:collapse; width:484px; table-layout:fixed; } td { overflow:hidden; text-overflow:ellipsis; } </style> </head> <body> <table width="200" borderColor="#7788cc" border="1" style="table-layout:fixed;"> <tr> <td width="80" title="人生最痛苦的事就是失去最亲的人。"> <nobr>人生最痛苦的事就是失去最亲的人。</nobr></td> <td><nobr>人生最痛苦的事就是失去最亲的人。</nobr></td> <td><nobr>人生最痛苦的事就是失去最亲的人。</nobr></td> </tr> </table> </body> </html>