对齐行中的单元格内容
- <html>
- <head>
- <script type="text/javascript">
- function leftAlign()
- {
- document.getElementById('header').align="left";
- }
- </script>
- </head>
- <body>
- <table width="100%" border="1">
- <tr id="header">
- <th>名</th>
- <th>姓</th>
- </tr>
- <tr>
- <td>John</td>
- <td>Adams</td>
- </tr>
- </table>
- <br />
- <input type="button" onclick="leftAlign()" value="左对齐表格行" />
- </body>
- </html>