元素内设置了不换行,又设置了固定宽度,怎么才能让超出的内容不显示出来?

sonofdragon 2005-05-31 03:53:02
<td>元素内设置了不换行,又设置了固定宽度,怎么才能让超出的内容不显示出来(就是不把表格自动伸长,要保持原来的宽度)?

请各位高手帮忙!
...全文
1984 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
seeu1688 2005-05-31
  • 打赏
  • 举报
回复
只要是以下三句:
<table style="table-layout:fixed" border=1 cellspacing=0 cellpadding=0>
<td width=400>
<div style="padding:0px;overflow:hidden" nowrap>内容....</div>



sonofdragon 2005-05-31
  • 打赏
  • 举报
回复
我想不换行,超出的部分自动隐藏。
vam_ma 2005-05-31
  • 打赏
  • 举报
回复
<td style="word-break:break-all"..>
輸入內容會自動換行的。
sonofdragon 2005-05-31
  • 打赏
  • 举报
回复
各位大虾帮帮忙啊
sonofdragon 2005-05-31
  • 打赏
  • 举报
回复
to qiangtian(答问题攒rp):
我是想在<td></td>元素里用。

to net_lover(孟子E章) :

我是想不换行,但是<td></td>定长,内容超出的就自动被下一个<td></td>覆盖掉。
孟子E章 2005-05-31
  • 打赏
  • 举报
回复
<table style="word-break:break-all;word-wrap:break-word">
qiangtian 2005-05-31
  • 打赏
  • 举报
回复
<DIV ID="oTxt" STYLE="background-color: #CFCFCF; width: 200px; height: 200px; overflow: hidden;">
<P>This <B>DIV</B> object has a lot of information.</P>

<P>So much information, in fact, that this text will extend beyond the height and width values specified in an inline style.</P>

<P>One of the ways to manage this is with the <B>overflow</B> attribute | <B>overflow</B> property.</P>

<P>By setting the <B>overflow</B> attribute inline on the <B>DIV</B> with a value of 'auto', the <B>DIV</B> will automatically add scrollbars if necessary.</P>

<P>Experiment with the different overflow settings by clicking the button at the top of the page.</P>
</DIV>
<input type="button" name="show" value="show" onclick="document.all.oTxt.style.overflow='auto'">

87,992

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧