使整个表成为一个链接 [英] Making a whole table a link

查看:69
本文介绍了使整个表成为一个链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想把整个表格作为一个链接,以便点击它上面的任何地方

将你带到另一页面。不幸的是,我最初想到这样做的方式是无效的html。我尝试了第二种有效的方法,但

的行为并不是很好(至少在firefox 1.5中没有),只有

的实际文本是链接。


我试过的例子可以在

http://www.bytronic.com/tests/links.html


我的问题是 - 有没有什么可以添加到

第二个示例的CSS中,使其表现得更像整个表格表现为

链接?这是完全有效的,还是我还需要添加一些

javascript?


提前致谢,


Martin


-

Martin Eyles
ma ****@eyles.bytr onic @ com

尝试将dot和ats交换成电子邮件。

解决方案

< blockquote>" Martin Eyles" < ma ********** @ NOSPAMbytronic.comwrote:


我想把整个表格作为一个链接,以便点击它上面的任何地方
带你到另一页。不幸的是,我最初想到这样做的方式涉及无效的html。



现在没关系有效性,这里的问题更多的是语义和

UI性质。很难想象整个表格是如何在语义上链接到另一个页面或部分的
。此外,它可能会导致用户无法识别此类链接。


> http://www.bytronic.com/tests/links.html



按照惯例,如果你没有b $ b分享你实际想要实现的目标,那么就不可能提供任何有意义的建议。示例中的虚假

内容不允许我们看到。


-

Spartanicus




Martin Eyles写道:


我想把整个表格作为链接,这样点击它上面的任何地方

会带你到另一页。



你不能,至少如果你想使用HTML链接而不是JS,写下

有效的HTML,并期望让它到处工作。所以相反,你需要使用多个< alinks,每个< tdcell中至少有一个。

无聊,但基本上很简单。


或者你可以通过HTML链接实现一个(或多个),然后

通过相关事件向整个表添加一个JS链接。它没有JS就会降低
降级,但不会无法解决。


" Spartanicus" < in ***** @ invalid.invalidwrote in message

news:44 ************************* ******* @ 4ax.com ...


" Martin Eyles" < ma ********** @ NOSPAMbytronic.comwrote:


>我想将整个表格作为链接,以便点击它上面的任何位置
将您带到另一个页面。不幸的是,我最初想到这样做的方式涉及无效的html。



现在没关系有效性,这里的问题更多的是语义和

UI性质。很难想象整个表格是如何在语义上链接到另一个页面或部分的
。此外,它可能会导致用户无法识别此类链接。


>> http://www.bytronic.com/tests/links.html



按照惯例,如果你没有b $ b分享你实际想要实现的目标,那么就不可能提供任何有意义的建议。示例中的虚假

内容不允许我们看到这一点。



该表包含有关机器的基本信息,并且在摘要页面上列出了几台

机器。目标链接将是一个页面,其中包含有关机器的更多详细信息,其中包括所有

表信息等。因此它将解释整个表格,

这就是为什么我觉得整个表格应该是一个链接。


整体表格的一部分原因表可点击,即使我不能说b * b代码语义合法,我希望它可以在触摸屏上使用

PC,用户可能不准确按下桌子的中心(和

因此第二个例子可能需要多次按下才能链接

)。


Hi,
I want to make a whole table a link, so that clicking anywhere on it
takes you to another page. Unfortunately the way I initially thought of
doing this involved invalid html. I have tried a second valid way, but the
behaviour is not quite as good (at least not in firefox 1.5), with only the
actual text being links.

The examples of what I have tried can be found at

http://www.bytronic.com/tests/links.html

My question is - is there anything that can be added to the css of the
second example, to make it behave more like the whole table behaving as a
link? Would this be completely effective, or would I also need to add some
javascript?

Thanks in advance,

Martin

--
Martin Eyles
ma****@eyles.bytronic@com
try swapping dots and ats to email.

解决方案

"Martin Eyles" <ma**********@NOSPAMbytronic.comwrote:

I want to make a whole table a link, so that clicking anywhere on it
takes you to another page. Unfortunately the way I initially thought of
doing this involved invalid html.

Never mind validity for now, the problem here is more of a semantic and
UI nature. It''s difficult to imagine how an entire table could be
semantically linked to another page or section. Additionally it would
likely cause users not to recognize such links.

>http://www.bytronic.com/tests/links.html

As per usual it''s impossible to offer any meaningful advice if you don''t
share what it is that you are actually trying to achieve. The bogus
content in the example doesn''t allow us to see that.

--
Spartanicus



Martin Eyles wrote:

I want to make a whole table a link, so that clicking anywhere on it
takes you to another page.

You can''t, at least if you want to use HTML links rather than JS, write
valid HTML, and expect to have it working everywhere. So instead you
need to use multiple <alinks, at least one in each <tdcell.
Boring, but basically simple.

Alternatively you can implement one (or more) through HTML links, then
add a JS link to the whole table through the relevant events. It
degrades without JS, but not unusably.


"Spartanicus" <in*****@invalid.invalidwrote in message
news:44********************************@4ax.com...

"Martin Eyles" <ma**********@NOSPAMbytronic.comwrote:

> I want to make a whole table a link, so that clicking anywhere on it
takes you to another page. Unfortunately the way I initially thought of
doing this involved invalid html.


Never mind validity for now, the problem here is more of a semantic and
UI nature. It''s difficult to imagine how an entire table could be
semantically linked to another page or section. Additionally it would
likely cause users not to recognize such links.

>>http://www.bytronic.com/tests/links.html


As per usual it''s impossible to offer any meaningful advice if you don''t
share what it is that you are actually trying to achieve. The bogus
content in the example doesn''t allow us to see that.

The table contains basic information about a machine, and there are several
machines laid out on the summary page. The target link will be a page with
more detailed information about the machine, which will include all the
table information and more. Therefore it will explain about the whole table,
which is why I felt the whole table should be a link.

Part of the reason for having the whole table clickable, even if I can''t
code that semantic legally, is that I want it to be useable on touch screen
PCs, where a user might not accuratley press the centre of the table (and
thus where the second example might need several presses before the link is
followed).


这篇关于使整个表成为一个链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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