Latest web development tutorials

HTML DOM td / th propriété vAlign

td / Objet th Référence td / e objets

Définition et utilisation

ensembles de propriétés valign ou renvoie la disposition verticale des données au sein de la cellule.

grammaire

Définition des propriétés valign:

tdObject.vAlign="baseline|bottom|middle|top"

或者

thObject.vAlign="baseline|bottom|middle|top"

Arrière propriétés valign:

tdObject.vAlign

或者

thObject.vAlign

描述
baseline 与基线对齐。
bottom 对内容进行下对齐。
middle 对内容进行下对齐。
top 对内容进行上对齐。


support du navigateur

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Tous les principaux navigateurs prennent en charge la propriété vAlign


Exemples

Exemples

L'exemple suivant modifie la disposition verticale des cellules dans les données:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Script>
fonction displayResult () {
. Document.getElementById ( 'd1') vAlign = "top";
document.getElementById ( 'dv2') vAlign = "top" .;
. Document.getElementById ( 'td3') vAlign = "top";
}
</ Script>
</ Head>
<Body>

<Table width = "50%" border = "1">
<Tr>
<Th> Prénom </ th>
<Th> Nom </ th>
<Th> Texte </ th>
</ Tr>
<Tr>
<Td id = "d1"> Peter </ td>
<Td id = "dv2"> Griffin </ td>
<Td id = "td3"> Bonjour, mon nom est Peter, je dois faire preuve d'un long texte, je dois faire preuve d'un long texte. </ Td>
</ Tr>
</ Table>
<br>
<Bouton type = "button" onclick = "displayResult ()"> Aligner le contenu up </ button>

</ Body>
</ Html>

Essayez »


td / Objet th Référence td / e objets