表格单元格内容超出时显示省略号效果(实现代码)
<meta charset="UTF-8" /> <title>表格演示</title> <style type="text/css"> table{ width: 100%; table-layout: fixed; } .name{ width: 10%; } .age{ width: 20%; } .sex{ width: 30%; } .addr{ width: 40%; } td{ white-space: nowrap;/*控制单行显示*/ overflow: hidden;/*超出隐藏*/ text-overflow: ellipsis;/*隐藏的字符用省略号表示*/ } </style> </head> <body> <table border="1" cellspacing="0" cellpadding="0"> <thead> <tr> (编辑:焦作站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |