社区
JavaScript
帖子详情
怎样使td中的文本正好适应td的大小?
bbsand
2006-05-10 04:50:51
我有一个表格:
0 1 2 3 4
|aa|bb|cc|dddddd|ee|
| | | |dd | |
td[3]是自动换行的。但是td[4]被隐藏以后,td[3]自动拉长了(因为我设定了Table的宽度)
这时候td[3]仍然是自动换行,但是变成了这样:
3
|dddddd |
|dd |
td还未填满就自动换行了,我希望填满一个td然后自动换行,请问应该设什么属性?或者说应该怎么办才能满足我的要求呢?解决了马上给分!时刻关注!多谢!
...全文
239
9
打赏
收藏
怎样使td中的文本正好适应td的大小?
我有一个表格: 0 1 2 3 4 |aa|bb|cc|dddddd|ee| | | | |dd | | td[3]是自动换行的。但是td[4]被隐藏以后,td[3]自动拉长了(因为我设定了Table的宽度) 这时候td[3]仍然是自动换行,但是变成了这样: 3 |dddddd | |dd | td还未填满就自动换行了,我希望填满一个td然后自动换行,请问应该设什么属性?或者说应该怎么办才能满足我的要求呢?解决了马上给分!时刻关注!多谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hchxxzx
2006-05-10
打赏
举报
回复
使用如下方式即可。
<table width="580">
<tr align="left">
<td height="20" width="28" align="center" nowrap>aa</td>
<td height="20" width="78" align="center" nowrap>bb</td>
<td height="20" width="58" align="center" nowrap>cc</td>
<td height="20" width="100%"align="left">ddddddddddddddd</td>
<td height="20" width="78" align="center" nowrap>ee</td>
</tr>
</table>
zeroleonhart
2006-05-10
打赏
举报
回复
用overflow试试看
clare2003
2006-05-10
打赏
举报
回复
<STYLE>
.vis1 { visibility:visible }
.vis2 { visibility:hidden }
</STYLE>
<table width="580">
<tr align="left">
<td height="20" width="28" align="center">aa</td>
<td height="20" width="78" align="center">bb</td>
<td height="20" width="58" align="center">cc</td>
<td height="20" width="58" align="left" style="word-break: break-all;">dddddddddddddddeeeeeee</td>
<td height="20" width="58" onclick="this.className='vis2';">ee</td>
</tr>
</table>
clare2003
2006-05-10
打赏
举报
回复
<STYLE>
.vis1 { visibility:visible }
.vis2 { visibility:hidden }
</STYLE>
<table width="580">
<tr align="left">
<td height="20" width="28" align="center">aa</td>
<td height="20" width="78" align="center">bb</td>
<td height="20" width="58" align="center">cc</td>
<td height="20" width="248"align="left">ddddddddddddddd</td>
<td onclick="this.className='vis2';">ee</td>
</tr>
</table>
laochake
2006-05-10
打赏
举报
回复
<table width=300 border=1>
<tr>
<td>00000</td>
<td>11111</td>
<td>222222222222</td>
<td style="word-break: break-all;">33333333333</td>
<td onclick="this.style.display='none';">44</td>
</tr>
</table>
bbsand
2006-05-10
打赏
举报
回复
<table width="580">
<tr align="left">
<td height="20" width="28" align="center">aa</td>
<td height="20" width="78" align="center">bb</td>
<td height="20" width="58" align="center">cc</td>
<td height="20" width="248"align="left">ddddddddddddddd</td>
<td height="20" width="78" align="center">ee</td>
</tr>
</table>
最后一列需要隐藏。
我试过隐藏后设置第3列的宽度为248+78,不行。。。。
laochake
2006-05-10
打赏
举报
回复
是不是设置了列宽
把代码贴出来看看
bbsand
2006-05-10
打赏
举报
回复
不是这样的,我需要表格撑开,但是想让文字填满撑开后的表格,
不想要它像现在这样,还没添满就换行了,表格后面有空白,
我想要没有空白,都用文字填满。
clare2003
2006-05-10
打赏
举报
回复
用这个css试一下
td,table,tr { word-wrap: break-word; table-layout:fixed;} 这样之后,表格就不会被撑开了
table方法实现图片自
适应
及脚本方法
季后赛的发送多个就会尽快回复符十大十大
Html+CSS
1.HTML标签是由尖括号包围的关键词,例如。2.HTML标签通常是成对出现的,例如和,我们称为双标签。标签对
中
的第一个标签是开始标签,第二个标签是结束标签。3.有些特殊的标签必须是单个标签(极少情况),例如
,我们称为单标签。1.以上三个代码vscode自动生成,基本不需要我们重写.2.文档类型声明标签,告诉浏览器这个页面采取htm15版本来显示页面.3.
列表表格及表单美化
字体样式的设置,属性有:font-family 设置字体类型 隶书font-size 设置字体
大小
12pxfont-style 设置字体风格 italicfont-wieght 设置字体的粗细 bold还可以将4
中
属性一起写入一个font
中
,不过要按照:字体风格---->字体粗细---->字体
大小
----...
IE8与IE7 IE6的区别
最近再弄在研究浏览器的兼容与解析问题,看到一篇文章收藏下。
测试了一两天的IE8发现,其
中
有很多东西都是和IE6和IE7不同的地方,包括css和javascript两个方面,在此记录备忘
1 IE8
中
的css
中
关于width或是height
中
如果使用像素形式作为参数时,参数必须是带“px”的,而且此参数必须是大于0的,而在IE6和IE7
中
是支持不带“px”参数的,而且参数是可以为一个负数。
2 IE8
中
的css
中
“border-style:outset ;”是没有效
新手笔记——编辑网页
文本
编辑网页
文本
<span>标签 作用:能让某几个文字或者某个词凸显出来 例: <p>享受<span class=”show”>”北大式”</span>教育服务</p> 字体样式 属性名 含义 举例 font-family设置字体类型 font-fa...
JavaScript
87,904
社区成员
224,614
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章