HTML <th> nowrapPropriété

Balise HTML <th>

Exemple

Cellule d'en-tête de tableau avec l'attribut nowrap :

<table border="1">
  <tr>
    <th>Mois</th>
    <th nowrap>Mes économies pour une nouvelle voiture</th>
  </tr>
  <tr>
    <td>Janvier</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>Février</td>
    <td>$80</td>
  </tr>
</table>

Essayez-le vous-même »

Prise en charge des navigateurs

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Tous les principaux navigateurs prennent en charge l'attribut nowrap.


Définition et utilisation

HTML5 ne prend pas en charge l'attribut nowrap de <th>. Utilisez CSS à la place.

L'attribut nowrap de <th> en HTML 4.01Obsolète。

L'attribut nowrap est un attribut booléen.

L'attribut nowrap indique que le contenu d'une cellule d'en-tête de tableau ne passe pas à la ligne.


Notes de compatibilité

En HTML 4.01, l'attribut nowrap de <th> est obsolète. Veuillez utiliser CSS à la place.

Syntaxe CSS : <th style="white-space: nowrap">

Exemple CSS : Aucun saut de ligne dans une cellule d'en-tête de tableau

Dans notre tutoriel CSS, vous pouvez trouver plus d'informations surla propriété white-spaceDétails.


Différences entre HTML et XHTML

En XHTML, la minimisation d'attribut est interdite, et l'attribut nowrap doit être défini comme <th nowrap="nowrap">.


Syntaxe

<th nowrap>


Balise HTML <th>autres extensions