自定义< ol>编号与希伯来数字 [英] Custom <ol> numbering with Hebrew numerals
问题描述
我希望有一个使用希伯来字母数字的编号列表,这在希伯来语的书中是常见的。而拉丁语符号使用数字0-9,希伯来语按字母顺序编号,除了这里和那里的值被改变的几个例外。我不知道这在CSS中是否可能,但也许是在JavaScript中。
我本质上喜欢这样:
< ol> < li>第一行< / li> < li>第二行< / li> < li>第三行< / li>< / ol>
变成这样:
.hebrew-numeral {padding- left:10px; }
< table dir =rtl> < tbody> < tr> < td class =hebrew-numeral>א< / td> < td>第一行< / td> < / tr> < tr> < td class =hebrew-numeral>ב< / td> < td>第二行< / td> < / tr> < tr> < td class =hebrew-numeral>ג< / td> < td>第三行< / td> < / tr> < / tbody>< / table>
I'd like to have a numbered list using Hebrew alphabet numerals, as is common in books in Hebrew. Whereas Latin notation uses digits 0-9, Hebrew is numbered alphabetically, with a few exceptions here and there where the value is changed around. I have no idea if this is even possible in CSS, but perhaps it is in JavaScript.
I'd essentially like to have something like this:
<ol>
<li>First Line</li>
<li>Second Line</li>
<li>Third Line</li>
</ol>
turn into something like this:
.hebrew-numeral {
padding-left: 10px;
}
<table dir="rtl">
<tbody>
<tr>
<td class="hebrew-numeral">א</td>
<td>First Row</td>
</tr>
<tr>
<td class="hebrew-numeral">ב</td>
<td>Second Row</td>
</tr>
<tr>
<td class="hebrew-numeral">ג</td>
<td>Third Row</td>
</tr>
</tbody>
</table>
http://jsfiddle.net/rfkrocktk/pFkd7/:
Is there a way to do this in CSS or in JavaScript? I could just use a table like in my example above, but is this really the best way of doing this?
You can do this easily with CSS's list-style-type: hebrew
property
ol { list-style-type: hebrew; }
<h1>Test</h1>
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
See example here: http://jsbin.com/icehis/2
这篇关于自定义< ol>编号与希伯来数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!