Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
148 views
in Technique[技术] by (71.8m points)

html - Make a whole row in a table "link-able"

I have this code where the whole div is clickable and link to different URLS

jsfiddle.net/#&togetherjs=eBw8xooaHu

I want to make it work in a table and make the whole row clickable so I ended up to smth like this..

jsfiddle.net/#&togetherjs=bKRMP3bSl3

Is this manageable or I am looking to the wrong direction?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I recomend to use Jasny Bootstrap.

The way to add Jasny to your project its the same whit bootstrap.

Before import the libraries adding the next lines:

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/css/jasny-bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.min.js"></script>

after that add the class to your table:

<table class="table table-striped table-bordered table-hover">

and the tbody tag

<tbody data-link="row" class="rowlink">

on first td tag add the link whit a tag, td content pushed in to a tag. Like this:

<td><a href="#inputmask">Input mask</a></td>

if you desire its no show link in a td, then add to this td tag the class:

<td class="rowlink-skip">

when, your row link its now working at 100%.

References: Jasny Bootstrap

Sample: Sample


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...