1,设置css样式

<style>
table {
width: 100%;
float: left;
table-layout:fixed;
width:600px;
border:1px solid #ccc;
 }

table tr {
    line-height: 25px;
    border:1px solid #ccc;
}

table td {
     border:1px solid #ccc;
     text-align:center;
 }
.MHover{
     border:1px solid #ccc;
     white-space:nowrap;
     text-overflow:ellipsis;
     overflow:hidden;
 }
</style>

2,js设置click和mousemove和mouseout事件

<script>
$(document).ready(function () {
        $(".MALL").hide();
        $(".MHover").click(function (e) {
            $(this).next(".MALL").css({"position":"absolute","top":e.pageY+5,"left":e.pageX+5}).show();
        });
        $(".MHover").mousemove(function (e) {
            $(this).next(".MALL").css({ "color": "fff", "position": "absolute", "opacity": "0.7", "background-color": "666", "top": e.pageY + 5, "left": e.pageX + 5 });
        });
        $(".MHover").mouseout(function () {
            $(this).next(".MALL").hide();
        });
    });
</script>

3,HTML内容,在td中新增两个div,两个div中的内容必须一致。

<table>
<tr>
<th>姓名</th>
<th>个性签名</th>
<th>性别</th>
</tr>
<tr>
<td>狗子</td>
<td>
<div class="MHover">嘻嘻嘻嘻嘻哈哈12345上山打老虎嘻嘻嘻嘻嘻哈哈</div>
<div class="MALL">嘻嘻嘻嘻嘻哈哈12345上山打老虎嘻嘻嘻嘻嘻哈哈</div>
</td>
<td>男</td>
</tr>
</table>

table中td文字超出长度用省略号隐藏超出内容,鼠标点击内容全部显示的更多相关文章

  1. CSS3让一段文字多余的用省略号表示,当鼠标移动上去的时候显示全部文字

    <style type="text/css"> div { width:100px; overflow:hidden; white-space:nowrap; text ...

  2. 如何让table中td宽度固定

    table中td会随着里面的内容伸缩,设置其width样式并没有效果.这个时候需要下面的CSS可以实现. 首先是设置table .table {table-layout:fixed;} 其次是td . ...

  3. 如何让table中td与四周有间距

    如何让table中td与四周有间距 方法一 在td下再添加一个会计元素 <tr> <td>第2节</td> <td>语文</td> < ...

  4. table中td内容过长 省略号显示

    首先设置 css样式: table { table-layout: fixed;} HTML中的table代码: <tr> <th class="col-md-1" ...

  5. text-overflow使用文字超多div的宽度或超过在table中<td>

    关键字:text-overflow:ellipsis 语法:text-overflow:clip | ellipsis 取值 clip:默认值.不显示省略标记(...),而是简单的裁切. ellips ...

  6. css实现table中td单元格鼠标悬浮时显示更多内容

    table中,td单元格无法显示下全部内容,需要在鼠标hover时显示全部内容. 正常显示样式: 鼠标hover时: html: <td>displayAddress<span cl ...

  7. 关于Jquery获取Table中td内的内容

    $(this).children().eq(1).text()获取的是显示的值$(this).children().eq(1).html()获取的是<td></td>之间的所有 ...

  8. 让table中td的内容靠上对齐

    valign=“top”; <td valign="top"></td> 点此查看详细table的td的valign属性

  9. 表格中td限宽溢出以省略号代替

    table.ms-listviewtable { table-layout:fixed; width: 100%; } table.ms-listviewtable td[role="gri ...

随机推荐

  1. 配置全文搜索引擎solr

    前言 solr是apache下的一个子项目,用java编写基于Lucene开发的全文搜索服务器,不同于Lucene,solr一个完成的搜索服务器,提供了众多接口调用,而Lucene只是个工具包.如果用 ...

  2. spring boot的gradle整合日志

    1.引入包configurations { providedRuntime // remove default logger all*.exclude group: 'org.springframew ...

  3. Nginx03(实现负载均衡)

    一.负载均衡的作用 1.转发功能 按照一定的算法[权重.轮询.Ip_Hash],将客户端请求转发到不同应用服务器上,减轻单个服务器压力,提高系统并发量. 2.故障移除 通过心跳检测的方式,判断应用服务 ...

  4. INPUT输入子系统【转】

    转自:https://www.cnblogs.com/deng-tao/p/6094049.html 1.Linux系统支持的输入设备繁多,例如键盘.鼠标.触摸屏.手柄或者是一些输入设备像体感输入等等 ...

  5. Ubuntu安装MDK

    1 环境部署 [x] Ubuntu 18.04 [x] Wine 3.0.4 1.0 查看CPU信息 lscpu 序号 属性 描述 1 架构 x86_64 2 CPU 运行模式 32-bit, 64- ...

  6. pytest生成allure报告

    在pytest框架中可以用很多插件来生成测试报告,本文总结下怎么生成allure报告 allure allure是一款开源的,专门用来展示测试结果的一个工具,allure可以与很多的测试框架做集成,比 ...

  7. 201871010107-公海瑜《面向对象程序设计(java)》第十周学习总结

    201871010107-公海瑜<面向对象程序设计(java)>第十周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这 ...

  8. Maven 中 dependencyManagement 元素,知识点

    Maven 提供的 dependencyManagement 元素既能让子模块继承到父模块的依赖配置,又能保证子模块依赖使用的灵活性.在 dependencyManagement 元素下的依赖声明不会 ...

  9. Python27期:错误宝典

    错误信息1:SyntaxError:invalid syntax--无效语法 解决办法:变量名不能使用关键字如下图: 错误信息2:TypeError:'str' object is not calla ...

  10. 解决 SpringMVC 非spring管理的工具类使用@Autowired注解注入DAO为null的问题

    在SpringMVC框架中,我们经常要使用@Autowired注解注入Service或者Mapper接口,我们也知道,在Controller层中注入service接口,在service层中注入其它的s ...