我可以在< td>中定位商品吗? [英] Can I position items inside a <td>?

查看:67
本文介绍了我可以在< td>中定位商品吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


是否可以在< td>内定位商品?元件?对于

实例,请参见下文。该表有多行,每行一个用于
数据库记录。每行有3个与之关联的href(用于

编辑,删除和更新)。我想将这3个href项目

放在相同的列中,如果跨度可能是
定位,那将是可行的 - 例如在td的最右边

包含它。


我不能使用2个或更多< td>元素为< td>使用ASP.NET转发器控件放在那里

- 所以除非使用< div>这个控件的

等效和< span>那不是

可能。


不知何故,我预计答案将是使用不同的

ASP.NET控件。如果那是

的情况,不要打扰回复。


++++++++++++ $ b< html>

< head>< title> DataList Position< / title>

< style type =" text / css">

cControl {position:inherit;左:600px的; text-align:right;

float:right}

< / style>

< / head>

< body>

< p>

< table>

< tr>

< TD> - 内容 -

< span class =" cControl">

< a href =" href A"> E< / a>

< a href =" href B"> D< / a>

< a href =" href C"> U< / a>

< / span>

< / td>

< / tr>

< tr>

< td> - 其他一些内容 -

< span class =" cControl">

< a href =" href A"> E< / a> ;

< a href =" href B"> D< / a>

< a href =" href C"> U< / a> ;

< / span>

< / td>

< / tr>

< / table>

< / body>

< / html>

Hello folks,

Is it possible to position an item within a <td> element? For
instance see below. The table has multiple rows, one for each
database record. Each row has 3 hrefs associated with it (for
edit, delete and update). I want to position these 3 href items
in the same columns, which would be posible if the span could be
positioned - for instance on the extreme right of the td in
which it is contained.

I can''t use 2 or more <td> elements as the <td> is put there
using an ASP.NET repeater control - so unless there is an
equivalent of this control using <div> and <span> that is not
possible.

Somehow, I anticipate that the answer will be to use a different
ASP.NET control. Don''t bother posting a reply if that is the
case.

++++++++++
<html>
<head><title>DataList Position</title>
<style type="text/css">
cControl {position:inherit; left:600px; text-align:right;
float:right}
</style>
</head>
<body>
<p>
<table>
<tr>
<td> -- Content --
<span class="cControl">
<a href="href A">E</a>
<a href="href B">D</a>
<a href="href C">U</a>
</span>
</td>
</tr>
<tr>
<td> -- Some other Content --
<span class="cControl">
<a href="href A">E</a>
<a href="href B">D</a>
<a href="href C">U</a>
</span>
</td>
</tr>
</table>
</body>
</html>

推荐答案

来自: 6. ********* *@spamgourmet.com
(Zenobia)
大家好,
是否可以将项目定位在
< td>内。元素?
From: 6.**********@spamgourmet.com
(Zenobia)
Hello folks,
Is it possible to position an item within a
<td> element?




< td align =" right"> ...使用中心或左边... ...< / td>


网页设计,魔术,绘画,Junking,更多
http://www.davmagic.com

画一个房子
http://www.paintahouse.com

注意:此电子邮箱已关闭不回复!!!



<td align="right"> ...use center or left also...</td>

Web Design, Magic, Painting, Junking, More
http://www.davmagic.com
Paint A House
http://www.paintahouse.com
NOTE: This emailbox is CLOSED do NOT reply!!!


Zenobia< 6. ********** @ spamgourmet.com>写道:
Zenobia <6.**********@spamgourmet.com> wrote:
是否可以在< td>内定位项目?元件?


是的。设定位置:相对;对于< td>然后定位:绝对;

以及孩子所需的左,右,上,下两个元素

元素。但要注意漏洞(IIRC Mozilla有一个令人讨厌的关于表格单元格的定位)。


实例见下文。该表有多行,每个
数据库记录一行。每行有3个与之关联的href(用于编辑,删除和更新)。我想将这3个href项目放在相同的列中,如果跨度可以定位,这将是可行的 - 例如在
中的td的最右侧。


当然。

td {position:relative;}

span {position:absolute;正确:0;}


但是从它的声音只是添加text-align:right;或

align =" right"对于td,在这种情况下也可以正常工作。

我不能使用2个或更多< td>元素为< td>是放在那里
使用ASP.NET转发器控件


听起来如果它不会让你插入ASP.NET严重破坏

三个coloumns而不是一个。我不认为这是严重的损坏(好吧不是那么严重破碎)所以我猜错误是

无论是你选择的控制还是你的实施它。

- 所以除非使用< div>这个控件相当于
和< span>那不可能。

不知何故,我预计答案将是使用不同的ASP.NET控件。如果那是
的话,不要打扰回复。


艰难。人们会发布人们想发布的内容。如果人们认为通过使用有缺陷的ASP.NET控件你是一个屁股,那么

他们会告诉你。

cControl {position:inherit;左:600px的; text-align:right;
float:right}


好​​吧,如果没有URL,我们将不得不假设这是你的

整个样式表。在这种情况下,它是75%没用。 position:inherit;

在没有父元素且位置设置的情况下工作

out as position:static;这意味着左:600px;将被忽略的
。 text-align不适用于内联元素(如跨度),但

float right使其成为块元素。但是没有指定宽度因此

很多(但不是全部)浏览器会缩小元素以适应

内容,因此text-align再次无用。 />
< p>


这个空段的重点是什么?如果你想在表格margin-top之上增加空间



< table>
< tr>
< td> - 内容 -
< span class =" cControl">
< a href =" href A"> E< / a>
< a href = href B> D< / a>
< a href =" href C"> U< / a>
< / span>
< / td> ;
Is it possible to position an item within a <td> element?
Yes. Set position: relative; for the <td> and then position: absolute;
and whichever of left, right, top and bottom you need for the child
element. However beware of bugs (IIRC Mozilla has a nasty one
concerning posititioning relative to table cells).
For
instance see below. The table has multiple rows, one for each
database record. Each row has 3 hrefs associated with it (for
edit, delete and update). I want to position these 3 href items
in the same columns, which would be posible if the span could be
positioned - for instance on the extreme right of the td in
which it is contained.
Sure.
td {position: relative;}
span {position: absolute; right: 0;}

But from the sound of it just adding text-align: right; or
align="right" for the td will work just as well in this case.
I can''t use 2 or more <td> elements as the <td> is put there
using an ASP.NET repeater control
Sounds like ASP.NET is seriously broken if it won''t let you insert
three coloumns instead of one. I don''t believe that it is seriously
broken (well not that seriously broken) so I guess that the mistake is
either your choice of control or your implementation of it.
- so unless there is an
equivalent of this control using <div> and <span> that is not
possible.

Somehow, I anticipate that the answer will be to use a different
ASP.NET control. Don''t bother posting a reply if that is the
case.
Tough. People will post what people want to post. And if people think
taht you''re being an arse by using a defective ASP.NET control then
they''ll tell you that.
cControl {position:inherit; left:600px; text-align:right;
float:right}
Well, in the absence of a URL we''ll have to assume that this is your
entire stylesheet. In which case it''s 75% useless. position: inherit;
in the absence of a parent element with position set is going to work
out as position: static; which means that left: 600px; will be
ignored. text-align doesn''t apply to inline elements like spans, but
float right makes it a block element. However no width is specified so
many (but not all) browsers will shrink the element to fit round the
content so the text-align is once again useless.
<p>
What''s the point of this empty paragraph? If you want to add space
above the table set margin-top.
<table>
<tr>
<td> -- Content --
<span class="cControl">
<a href="href A">E</a>
<a href="href B">D</a>
<a href="href C">U</a>
</span>
</td>




那么跨度应该从CSS中浮动到右边。那不是你想要的吗?如果您希望跨度与您的其他

内容并列,那么您应该先放置跨度。


Steve


-

我的理论给你起见,我的异端邪说你,

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


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



Well the span should be floated to the right from your CSS. Isn''t that
what you wanted? If you wanted the span to be alongside your other
content then you should have place the span first.

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/>


2004年6月14日星期一13:07:24 -0400,Davmagic .Com< DL * *@webtv.net>写道:
On Mon, 14 Jun 2004 13:07:24 -0400, Davmagic .Com <DL**@webtv.net> wrote:
来自: 6 。********** @ spamgourmet.com
(Zenobia)
大家好,
是否有可能在一个项目内定位
< TD>元素?
< td align =" right"> ...使用中心或左边... ...< / td>
From: 6.**********@spamgourmet.com
(Zenobia)
Hello folks,
Is it possible to position an item within a
<td> element?
<td align="right"> ...use center or left also...</td>




除了最新的HTMl之外,不推荐使用align属性。请不要建议

这个方法。

网页设计,魔术,绘画,Junking,更多
http://www.davmagic.com
画一个房子
http://www.paintahouse.com
注意:此邮箱已关闭请勿回复!!!



Except in up-to-date HTMl the align attribute is deprecated. Don''t advise
this method, please.
Web Design, Magic, Painting, Junking, More
http://www.davmagic.com
Paint A House
http://www.paintahouse.com
NOTE: This emailbox is CLOSED do NOT reply!!!




哦我的。



Oh my.


这篇关于我可以在&lt; td&gt;中定位商品吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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