在表格中显示和隐藏部分文本

时间:2017-05-31 10:48:37

标签: javascript

请帮助

在表格中显示和隐藏部分文字 enter image description here

谢谢

2 个答案:

答案 0 :(得分:0)

<html dir="rtl">

<head>
  <meta http-equiv="Content-Language" content="utf-8">
  <title></title>
</head>

<body>

  <div align="center">
    (<span lang="ar-sa">0,5</span><span lang="en-us">)</span>substring
    <p>&nbsp;</p>
    <table border="1" style="border-collapse: collapse" width="221" bordercolorlight="#808080" bordercolordark="#808080">
      <tr>
        <td><span lang="en">Hello all</span></td>
      </tr>
      <tr>
        <td><span lang="en">how are you</span></td>
      </tr>
    </table>
  </div>
  <p align="center"><input type="button" value="    Hide    " name="B4"><span lang="en-us">&nbsp;&nbsp;
</span><input type="button" value="    show    " name="B3"></p>

</body>

</html>

答案 1 :(得分:0)

您可以在鼠标悬停时显示全文,否则隐藏。

 <div>
    <table>
        <tr>
            <td onmouseover="document.getElementById('textbox').innerHTML='Text to Show'" onmouseout="document.getElementById('textbox').innerHTML='Truncated Text'">
            <div id="textbox">Truncated Text</div></td>
        </tr>  
    </table>
</div>