diff options
author | julieng <julien.gattelier@gmail.com> | 2021-08-03 08:03:23 +0200 |
---|---|---|
committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-09-03 08:08:25 +0200 |
commit | bf8e099b9c8b3c60d60b3712b4fc97b052c39887 (patch) | |
tree | c101746d082c9581c94f5937519c7d0e2f4af8cb /files/fr/web/javascript/reference/global_objects/string/fixed | |
parent | 844f5103992238c0c23203286dad16a466e89c97 (diff) | |
download | translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.gz translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.bz2 translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.zip |
convert content to md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/string/fixed')
-rw-r--r-- | files/fr/web/javascript/reference/global_objects/string/fixed/index.md | 80 |
1 files changed, 32 insertions, 48 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/string/fixed/index.md b/files/fr/web/javascript/reference/global_objects/string/fixed/index.md index c014787858..482010f528 100644 --- a/files/fr/web/javascript/reference/global_objects/string/fixed/index.md +++ b/files/fr/web/javascript/reference/global_objects/string/fixed/index.md @@ -11,63 +11,47 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/String/fixed original_slug: Web/JavaScript/Reference/Objets_globaux/String/fixed --- -<div>{{JSRef}}{{deprecated_header}}</div> +{{JSRef}}{{deprecated_header}} -<p>La méthode <code><strong>fixed()</strong></code> permet de créer un élément HTML {{HTMLElement("tt")}}, ce qui permet d'afficher le texte de la chaîne de caractère dans une fonte à chasse fixe.</p> +La méthode **`fixed()`** permet de créer un élément HTML {{HTMLElement("tt")}}, ce qui permet d'afficher le texte de la chaîne de caractère dans une fonte à chasse fixe. -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox"><var>str</var>.fixed()</pre> + str.fixed() -<h3 id="Valeur_de_retour">Valeur de retour</h3> +### Valeur de retour -<p>Une chaîne de caractères représentant un élément HTML {{HTMLElement("tt")}}.</p> +Une chaîne de caractères représentant un élément HTML {{HTMLElement("tt")}}. -<h2 id="Description">Description</h2> +## Description -<p>La méthode <code>fixed()</code> encadre une chaîne de caractères dans une balise <code><tt></code> :<br> - <code>"<tt>str</tt></code>"</p> +La méthode `fixed()` encadre une chaîne de caractères dans une balise `<tt>` : +`"<tt>str</tt>`" -<h2 id="Exemples">Exemples</h2> +## Exemples -<p>L'exemple suivant illustre l'utilisation de la méthode <code>fixed</code> pour formater une chaîne de caractères :</p> +L'exemple suivant illustre l'utilisation de la méthode `fixed` pour formater une chaîne de caractères : -<pre class="brush:js">var worldString = "Coucou monde"; +```js +var worldString = "Coucou monde"; console.log(worldString.fixed()); -// "<tt>Coucou monde</tt>" -</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">État</th> - <th scope="col">Commentaires</th> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-string.prototype.fixed', 'String.prototype.fixed')}}</td> - <td>{{Spec2('ES6')}}</td> - <td>Définition initiale. Implémentée dans JavaScript 1.0. Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web.</td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-string.prototype.fixed', 'String.prototype.fixed')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td>Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.String.fixed")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("String.prototype.bold()")}}</li> - <li>{{jsxref("String.prototype.italics()")}}</li> - <li>{{jsxref("String.prototype.strike()")}}</li> -</ul> +// "<tt>Coucou monde</tt>" +``` + +## Spécifications + +| Spécification | État | Commentaires | +| ------------------------------------------------------------------------------------------------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| {{SpecName('ES6', '#sec-string.prototype.fixed', 'String.prototype.fixed')}} | {{Spec2('ES6')}} | Définition initiale. Implémentée dans JavaScript 1.0. Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web. | +| {{SpecName('ESDraft', '#sec-string.prototype.fixed', 'String.prototype.fixed')}} | {{Spec2('ESDraft')}} | Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web. | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.String.fixed")}} + +## Voir aussi + +- {{jsxref("String.prototype.bold()")}} +- {{jsxref("String.prototype.italics()")}} +- {{jsxref("String.prototype.strike()")}} |