2012-09-28 32 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>​