我想能夠使用引導3或/和純CSS爲了亮點當前使用CSS和Bootstrap 3在html表格的行和列上徘徊。爲了突出當前徘徊,在HTML表格的行和列
這可能不使用自定義JavaScript和保持Bootstrap表的響應性?
任何人都可以提供建議和/或鏈接?
我想能夠使用引導3或/和純CSS爲了亮點當前使用CSS和Bootstrap 3在html表格的行和列上徘徊。爲了突出當前徘徊,在HTML表格的行和列
這可能不使用自定義JavaScript和保持Bootstrap表的響應性?
任何人都可以提供建議和/或鏈接?
添加.table-hover
,使上表中的行懸停狀態
<table class="table table-hover">
...
</table
創建.table-responsive
類父div來響應性
<div class="table-responsive">
<table class="table table-hover">
...
</table>
</div>
UPDATE
解決方案與:nth-child()
識別:hover
列號
謝謝。你是否知道一種將相同行爲應用於當前列和當前行的方法? – balteo
@balteo我不認爲這是可能的,而不使用JavaScript。因爲CSS沒有提供任何選項來標識精確的列:(你可以使用一些像腳本的解決方案,像這樣http://css-tricks.com/row-and-column-highlighting/ – Muhammed
嗯,我找到了東西在這裏:http://stackoverflow.com/questions/848840/cols-colgroups-and-css-hover-psuedoclass與其相應的小提琴:http://jsfiddle.net/ThinkingStiff/rUhCa/但它沒有響應所有和不與自舉... – balteo
*** bootstrap-3.3.7 ***
You are using *bootstrap.min.css* or *bootstrap.css*.
1.Open *bootstrap.min.css* or *bootstrap.css*
that you include with *link tag* in your html file.
2.Find the code below in *bootstrap.min.css* or *bootstrap.css*
whose class name is *table-hover*.
.table-hover > tbody > tr:hover {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
display: table-column;
float: none;
}
3.Paste the new code below after the above code
whose class name is *table-hoverCell*.
.table-hoverCell > tbody > tr > td:hover {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
display: table-column;
float: none;
}
4.The final appearance is like this
.table-hover > tbody > tr:hover {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
display: table-column;
float: none;
}
.table-hoverCell > tbody > tr > td:hover {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
display: table-column;
float: none;
}
*** I use *bootstrap.css* for this explanation
so final appearance is different from *bootstrap.min.css*.
The code in *bootstrap.min.css* is written without any linebreaks
so you can easily do find and paste using *bootstrap.css*. ***
請編輯你的答案以分開說明和代碼示例。 –
你能後至今你已經嘗試的代碼? – Pattle
難道你不能只是添加一個'newClass'到當前表並在css中添加'newClass:hover'? – jayeshkv
@ MAD4RA:謝謝。我知道:懸停,但是爲了讓當前列「被選中」並突出顯示,我在哪裏放置它? – balteo