将文本分成两列 [英] flow text into two columns

查看:76
本文介绍了将文本分成两列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一系列的东西


< P> * 20050108< / p>

< p> * 20050120< / p>

< p> * 20050116< / p>

< p> * 20050119< / p>

.. ..

....


超过一百件商品。

有没有办法使用css让它流动分为2列?


而不是在表格中手动硬编码:


< table>< tr>< td>

....

< / td>

< td>

....

< / td>

< / tr>< / table>


谢谢。


Xah
xa*@xahlee.org
http://xahlee.org/PageTwo_dir/more.html

suppose i have a list of things

<P>* 20050108 </p>
<p>* 20050120 </p>
<p>* 20050116 </p>
<p>* 20050119 </p>
....
....

over a hundred items.
is there a way to use css so that it flows into 2 columns?

as opposed to manually hardcode in table:

<table><tr><td>
....
</td>
<td>
....
</td>
</tr></table>

Thanks.

Xah
xa*@xahlee.org
http://xahlee.org/PageTwo_dir/more.html

推荐答案

* Xah Lee *< xa*@xahlee.org>:
*Xah Lee* <xa*@xahlee.org>:

假设我有一份清单

< P> * 20050108< / p>
< p> * 20050120< / p>
< p> * 20050116< / p>
< p> * 20050119< / p>


你的意思是


< ul>

< li> 20050108< / li>

< li> 20050120< / li>

< li> 20050116< / li>

< li> 20050119< / li>

...?

有没有办法使用css使它流入2列?

suppose i have a list of things

<P>* 20050108 </p>
<p>* 20050120 </p>
<p>* 20050116 </p>
<p>* 20050119 </p>
You mean

<ul>
<li>20050108</li>
<li>20050120</li>
<li>20050116</li>
<li>20050119</li>
...?
is there a way to use css so that it flows into 2 columns?




' 'float'':< http://webdesign.crissov.de/temp/multicol-lists>

我认为这个解决方案存在一些缺陷,但我不记得了/>
哪个。


-

丑陋的事实,真实的朋友告诉你。

King Pellinore(卡米洛特)



''float'': <http://webdesign.crissov.de/temp/multicol-lists>
I think there were some flaws with that solution, but I don''t remember
which.

--
"The uglier the truth, the truer the friend that told you."
King Pellinore (Camelot)





Xah Lee写道:


Xah Lee wrote:
假设我有一系列的东西
< P> * 20050108< / p>
< p> * 20050120< / p>
< p> * 20050116< / p> ;
< p> * 20050119< / p>
超过一百项。
有没有办法使用css所以t帽子它流入2列?
而不是在表格中手动硬编码:
谢谢。
Xah
suppose i have a list of things
<P>* 20050108 </p>
<p>* 20050120 </p>
<p>* 20050116 </p>
<p>* 20050119 </p>
over a hundred items.
is there a way to use css so that it flows into 2 columns?
as opposed to manually hardcode in table:
Thanks.
Xah




怎么样这个?改编自:
http:/ /www.fu2k.org/alex/css/cssjunk/ListColumns.mhtml

<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Transitional // EN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

< html>

< head>

< title> Untitled< / title>

< META HTTP-EQUIV =" Content-Type" CONTENT =" text / html的; charset = ISO-8859-1">

< style type =" text / css">

body {

width :100%;

}

..colwrapper {

border:1px solid red;

padding:0px ;

/ *保证金:50px; * /

宽度:50%;

}

li {

float:left;

宽度:180px;

保证金:0;

填充:0;

border:0;

}

< / style>

< / head>

< body>

< ; div class =''colwrapper''>

< ul class =" twocol">

< li> Papaya< / li>

< li>芒果< / li>

< li>香蕉香蕉香蕉香蕉香蕉< / li>

< li> Pineapple< / li>

< li> Cantaloupe< / li>

< li>西瓜< / li>

< li> Apricot< / li>

< li> Pear< / li>

< li> Pineapple< / li>

< li> Cantaloupe< ; / li>

< li>西瓜< / li>

< li> Apricot< / li>

< li> Pear< / li>

< li> Pineapple< / li>

< li> Cantaloupe< / li>

< li>西瓜< / li>

< li> Apricot< / li>

< li> Pear< / li>

< li> Pear< / li>

< li> Pineapple< / li>

< li> Cantaloupe< / li>

< li>西瓜< / li>

< li> Apricot< / li>

< li> Pear< / li> ;

< / ul>

< / div>

< / body>

< / html>



How about something like this? Adapted from:

http://www.fu2k.org/alex/css/cssjunk/ListColumns.mhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<style type="text/css">
body{
width: 100%;
}
..colwrapper{
border: 1px solid red;
padding: 0px;
/* margin: 50px; */
width: 50%;
}
li {
float: left;
width: 180px;
margin: 0;
padding: 0;
border: 0;
}
</style>
</head>
<body>
<div class=''colwrapper''>
<ul class="twocol">
<li>Papaya</li>
<li>Mango</li>
<li>Banana banana banana banana banana</li>
<li>Pineapple</li>
<li>Cantaloupe</li>
<li>Watermelon</li>
<li>Apricot</li>
<li>Pear</li>
<li>Pineapple</li>
<li>Cantaloupe</li>
<li>Watermelon</li>
<li>Apricot</li>
<li>Pear</li>
<li>Pineapple</li>
<li>Cantaloupe</li>
<li>Watermelon</li>
<li>Apricot</li>
<li>Pear</li>
<li>Pear</li>
<li>Pineapple</li>
<li>Cantaloupe</li>
<li>Watermelon</li>
<li>Apricot</li>
<li>Pear</li>
</ul>
</div>
</body>
</html>


不,我不是说< li> ...


我是指一个<的列表; p>简短的事情< / p>或者甚至< p>一个长段< / p>,

和我希望一些自动流入2列,而不是

手动创建两个类每个样式都是一个列,并将每个标签分配给正确的类......


谢谢。


Xah
xa*@xahlee.org
http://xahlee.org/PageTwo_dir/more.html

No i don''t mean <li>...

I mean a list of <p>short things</p> or even <p>one long paragraph</p>,
and i was hoping for some auto flow into 2 columns, as opposed to
manually creating two class of styles each being a column, and assign
each tag to the right class...

Thanks.

Xah
xa*@xahlee.org
http://xahlee.org/PageTwo_dir/more.html


这篇关于将文本分成两列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆