English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die "table width"-Eigenschaft legt die Breite der Tabelle fest. Wenn die "width"-Eigenschaft nicht gesetzt ist, belegt die Tabelle den erforderlichen Raum für die Anzeige der Daten.
mit 300 Pixel breite HTML-Tabelle:
<table width="300" border="1"> <tr> <th>Name</th> <th>Credits</th> </tr> <tr> <td>Zhang San</td> <td>90</td> </tr> <tr> <td>Li Si</td> <td>87</td> </tr> </table>Test see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the width attribute.
HTML5 The <table> width attribute is not supported. Please use CSS instead.
The width attribute specifies the width of the table.
If the width attribute is not set, the table will occupy the necessary space to display the table data.
Tip:For practical purposes, it is better not to specify the width, but to use CSS to apply width (width)。
<table width="pixels|%">
Value | Description |
---|---|
pixels | Set the width as pixels (example: width="50")。 |
% | Set the width of the element as a percentage of the containing element (example: width="50%")。 |