HTML 参考手册
HTML <th> nowrap 属性
CSS - 实例:表头单元格中不换行
源代码:
点击运行 »
<html> <body> <p>Table with nowrap:</p> <table border="1"> <tr> <th>Month</th> <th style="white-space:nowrap">My Savings for a new car</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> <p>Table without nowrap:</p> <table border="1"> <tr> <th>Month</th> <th>My Savings for a new car</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> <p><b>Note:</b> You might have to reduce the browser window to see the effect.</p> </body> </html>
运行结果:
点击运行 »