[JavaScript] JS代码控制表格行的文本对齐 →→→→→进入此内容的聊天室

来自 , 2019-07-20, 写在 JavaScript, 查看 101 次.
URL http://www.code666.cn/view/9cea886b
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function leftAlign()
  6. {
  7. document.getElementById('header').align="left";
  8. }
  9. </script>
  10. </head>
  11. <body>
  12.  
  13. <table width="100%" border="1">
  14. <tr id="header">
  15. <th>Firstname</th>
  16. <th>Lastname</th>
  17. </tr>
  18. <tr>
  19. <td>Peter</td>
  20. <td>Griffin</td>
  21. </tr>
  22. </table>
  23. <br>
  24. <input type="button" onclick="leftAlign()" value="Left-align table row" />
  25.  
  26. <p><b>Note:</b> This example does not work in Internet Explorer.</p>
  27.  
  28. </body>
  29. </html>
  30.  
  31. //javascript/7991

回复 "JS代码控制表格行的文本对齐"

这儿你可以回复上面这条便签

captcha