2012-09-28 33 views
0

我想顯示我的文本內容,如下圖所示。怎麼做? 我試過this,但它沒有從第二行縮進。 我也試圖把這個內容放在<表格中,有2行和2列,但問題是我不能保證<表格>正如我所願。 <表格>有許多邊距和填充問題。訂購列表中的縮進文本

enter image description here

更新:

代碼縮進正確的,但問題是我不能保證金錶像我想要的。

<table> 
    <tr> 
     <td>(1) </td> 
     <td>zzzzzzzzzzzzzzzzzzz</td> 
    </tr> 

    <tr> 
     <td>(2) </td> 
     <td>zzzzzzzzzzzzzzzzzzz</td> 
    </tr> 
</table> 

回答

0

你的意思是說像this

<ol> 
<li>content heerrrrrrrrrrrrere content heerrrrrrrrrrrrere content heerrrrrrrrrrrrere</li> 
<li>content heerrrrrrrrrrrrere content heerrrrrrrrrrrrere content heerrrrrrrrrrrrere</li> 
</ol>​ 

ol{padding-left:80px;list-style-type:decimal;} 

li{ 
    width:100px; 
    word-wrap:break-word; 
} 

+0

沒有,它必須是(1),(2),......這就是問題所在。 – Emerald214

+0

哎呀好吧,我會嘗試 –

+0

更新..... :) –

0

**[Demo][1] **

HI現在習慣了這種計數器復位CSS3中

由於這樣

的CSS

body {counter-reset:section;} 
h1 {counter-reset:subsection;} 
h1:before 
{ 
counter-increment:section; 
content:"Section " counter(section) ". "; 
} 
h2:before 
{ 
counter-increment:subsection; 
content:counter(section) "." counter(subsection) " "; 
} 

HTML

<h1>HTML tutorials</h1> 
<h2>HTML Tutorial</h2> 
<h2>XHTML Tutorial</h2> 
<h2>CSS Tutorial</h2> 

<h1>Scripting tutorials</h1> 
<h2>JavaScript</h2> 
<h2>VBScript</h2> 

<h1>XML tutorials</h1> 
<h2>XML</h2> 
<h2>XSL</h2> 

[Demo][2]


更新Demo

+0

不,它必須是(1),(2),..第二行,第三行縮進標籤。 – Emerald214

+0

嗨@ Emerald214你喜歡這個http://tinkerbin.com/mtOgW1fG –

0

Demo

CSS

ul { 
    counter-reset:myCounter; 
    list-style:none; 
    padding:0; 
    margin:0; 
}  
ul li { 
    padding-left:30px; /* adjust it to your custom font needings */ 
    position:relative; 
    counter-increment:myCounter; 
} 
ul li:before { 
    content:"("counter(myCounter)") "; 
    position:absolute; 
    left:5px; 
}​ 

HTML

<ul> 
<li>Content here<br>and here<br>and here</li> 
<li>Some more content here<br>and here<br>and here</li> 
</ul>​