表中的col元素不起作用 [英] col element in table not working

查看:148
本文介绍了表中的col元素不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含三列的表格,我希望第一个

列中的数据左对齐,而其余列中的数据要对齐

右:


#testTable {text-align:right; }

#leftcol {text-align:left; }


< table id =" testTable">

< col id =" leftCol" />

< col span =" 2" />

< tr> ...


看不到ID为leftCol的属性。


-

Haines Brown
br **** @ hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

解决方案

Haines Brown< br **** @ teufel.hartford-hwp.com>写道:

我有一个包含三列的表,我希望第一个
列中的数据左对齐,而其余列中的数据对齐
右:

#testTable {text-align:right; }
#leftcol {text-align:left; }

< table id =" testTable">
< col id =" leftCol" />
< col span =" 2" />
< tr> ...

在ID leftCol中定义的属性不可见。




取决于属性,只有少数属性允许为列定义

,而text-align不是其中之一:
http://www.w3.org/TR/CSS2/tables.html#q4


史蒂夫


-

我的理论适用于你,我的异端邪说你,

我从不回信,你也不喜欢我的领带。 - 医生


Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>





Haines Brown写道:
< blockquote class =post_quotes>我有一个包含三列的表,我希望第一个
列中的数据左对齐,而其余列中的数据对齐
右:

#testTable {text-align:right; }
#leftcol {text-align:left; }

< table id =" testTable">
< col id =" leftCol" />
< col span =" 2" />
< tr> ...

ID ID为leftCol中定义的属性。




请参阅
http://www.w3.org/TR/ CSS2 / tables.html #q4

,CSS属性可以应用于表格列,只有边框,

背景,宽度,可见性。


-


Martin Honnen
http://JavaScript.FAQTs.com/


On Sun,2003年12月14日11:42:39 GMT,Haines Brown

< br **** @ teufel.hartford-hwp.com>写道:

我有一个包含三列的表,我希望第一个
列中的数据左对齐,而其余列中的数据对齐
右:

#testTable {text-align:right; }
#leftcol {text-align:left; }

< table id =" testTable">
< col id =" leftCol" />
< col span =" 2" />
< tr> ...

看不到ID为leftCol中定义的属性。




''text列和列组不支持-align''。只能为列设置几个CSS

属性。


参见
http://www.w3.org/TR/CSS21/tables.html#q4


http://ln.hixie .ch /?start = 1070385285& count = 1

-

Rijk van Geijtenbeek


网络是一种拖延器具:

它可以吸收所需的时间,以确保你不会得到任何实际完成的工作。 - J.Nielsen


I have a table with three columns, and I want the data in the first
column to align left, while that in the remaining columns to align
right:

#testTable { text-align: right; }
#leftcol { text-align: left; }

<table id="testTable">
<col id="leftCol" />
<col span="2" />
<tr>...

Properties defined in ID leftCol are not seen.

--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

解决方案

Haines Brown <br****@teufel.hartford-hwp.com> wrote:

I have a table with three columns, and I want the data in the first
column to align left, while that in the remaining columns to align
right:

#testTable { text-align: right; }
#leftcol { text-align: left; }

<table id="testTable">
<col id="leftCol" />
<col span="2" />
<tr>...

Properties defined in ID leftCol are not seen.



Depends on the properties, there are only a few properties that are
allowed to be defined for columns, and text-align is not one of them:
http://www.w3.org/TR/CSS2/tables.html#q4

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don''t like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>




Haines Brown wrote:

I have a table with three columns, and I want the data in the first
column to align left, while that in the remaining columns to align
right:

#testTable { text-align: right; }
#leftcol { text-align: left; }

<table id="testTable">
<col id="leftCol" />
<col span="2" />
<tr>...

Properties defined in ID leftCol are not seen.



See
http://www.w3.org/TR/CSS2/tables.html#q4
on which CSS properties can be applied to table columns, only border,
background, width, visibility.

--

Martin Honnen
http://JavaScript.FAQTs.com/


On Sun, 14 Dec 2003 11:42:39 GMT, Haines Brown
<br****@teufel.hartford-hwp.com> wrote:

I have a table with three columns, and I want the data in the first
column to align left, while that in the remaining columns to align
right:

#testTable { text-align: right; }
#leftcol { text-align: left; }

<table id="testTable">
<col id="leftCol" />
<col span="2" />
<tr>...

Properties defined in ID leftCol are not seen.



''text-align'' is not supported in columns and column-groups. Only a few CSS
properties can be set for columns.

See
http://www.w3.org/TR/CSS21/tables.html#q4
and
http://ln.hixie.ch/?start=1070385285&count=1
--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you won''t get any
real work done. - J.Nielsen


这篇关于表中的col元素不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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