HTML DOM td / th propriété chOff
Définition et utilisation
ensembles de propriétés chOff ou renvoie le décalage du caractère d'alignement des cellules.
grammaire
Définition des propriétés chOff:
tdObject.chOff="px|%"
或者
thObject.chOff="px|%"
或者
thObject.chOff="px|%"
Retour chOff propriétés:
tdObject.chOff
或者
thObject.chOff
或者
thObject.chOff
Astuce: la propriété chOffn'a pas de valeur par défaut.
值 | 描述 |
---|---|
px | 定义了水平偏移,以像素为单位 |
% | 使用百分比定义了水平偏移 |
support du navigateur
Tous les principaux navigateurs prennent en charge la propriété chOff, mais sans aucun navigateur majeur remplira les fonctions de cette propriété.
Exemples
Exemples
colonne "" du côté droit "épargne" de l'alignement des deux personnages.:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
var c=document.getElementById("myCol");
alert("ch属性的水平偏移为: " + c.chOff);
}
</script>
</head>
<body>
<table border="1">
<colgroup>
<col>
<col id="myCol" align="char" char="." charoff="2">
</colgroup>
<tr>
<th>月份</th>
<th>存款</th>
</tr>
<tr>
<td>January</td>
<td>$100.00</td>
</tr>
<tr>
<td>February</td>
<td>$10.00</td>
</tr>
</table>
<br>
<button type="button" onclick="displayResult()">字符对齐的水平偏移</button>
<p><b>注意:</b>不是所有主流浏览器都支持choff属性的功能。</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
var c=document.getElementById("myCol");
alert("ch属性的水平偏移为: " + c.chOff);
}
</script>
</head>
<body>
<table border="1">
<colgroup>
<col>
<col id="myCol" align="char" char="." charoff="2">
</colgroup>
<tr>
<th>月份</th>
<th>存款</th>
</tr>
<tr>
<td>January</td>
<td>$100.00</td>
</tr>
<tr>
<td>February</td>
<td>$10.00</td>
</tr>
</table>
<br>
<button type="button" onclick="displayResult()">字符对齐的水平偏移</button>
<p><b>注意:</b>不是所有主流浏览器都支持choff属性的功能。</p>
</body>
</html>
Essayez »
td / e objets