菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> <script> function displayResult(){ document.getElementById('tr2').vAlign="top"; } </script> </head> <body> <table width="50%" border="1"> <tr id="tr1"> <th>第一个名称</th> <th>下一个名称</th> <th>文本</th> </tr> <tr id="tr2"> <td>Peter</td> <td>Griffin</td> <td>你好,我的名字叫Perter,我需要一个长文本来演示,我需要一个长文本来演示。</td> </tr> </table> <br> <button type="button" onclick="displayResult()">内容向上对齐</button> </body> </html>
运行结果