安科网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <script> function displayResult() { document.getElementById('tr2').vAlign="top"; } </script> </head> <body> <table width="50%" border="1"> <tr id="tr1"> <th>Firstname</th> <th>Lastname</th> <th>Text</th> </tr> <tr id="tr2"> <td>Peter</td> <td>Griffin</td> <td>Hello my name is Peter Griffin. I need a long text for this example. I need a long text for this example.</td> </tr> </table> <br> <button type="button" onclick="displayResult()">Top-align content</button> </body> </html>
运行结果
Copyright © 2013 - 2019 Ancii.com All Rights Reserved
京ICP备18063983号-5
京公网安备11010802014868号