简体   繁体   English

将鼠标悬停在表格单元格分隔符HTML / CSS / JS上时的悬停效果

[英]Hover effect when mousing over table cell dividers HTML/CSS/JS

I have the current following table: 我有当前的下表:

 <table border="1"> <tr> <td></td> <td>Banana</td> <td>Orange</td> <td>Plum</td> </tr> <tr> <td>Banana</td> <td>1:1</td> <td>1:2</td> <td>1:3</td> </tr> <tr> <td>Orange</td> <td>2:1</td> <td>1:1</td> <td>1,5:1</td> </tr> <tr> <td>Plum</td> <td>1:3</td> <td>2:1</td> <td>1:1</td> </tr> 

I am looking to cause a trigger when I am mousing over the cell dividers , AS indicated bellow. 当我将鼠标悬停在细胞分隔板上时,我希望引起触发,如下面所示。 This needs to be done in either HTML/CSS/jss. 这需要在HTML / CSS / jss中完成。 I can easily figure out a hover for the table or for the individual cells, but how could I get something to trigger when hovering over the cell dividers? 我可以很容易地找出表格或单个单元格的悬停,但是当悬停在单元格分隔符上时如何获得触发的东西? (see following image) (见下图)

图片1

tr td{
  position:relative;
}
tr td::after{
  position:absolute;
  right:-2px; 
  width:4px;
  cursor:pointer;
  top:0px;
  height:100%;
  z-index:1;
}
tr td::nth-last-of-type::after{
  display:none;
}

Now you can trigger anything by selecting 'tr td::after' as a selector 现在,您可以通过选择“ tr td :: after”作为选择器来触发任何操作

Also, width and right can be changed according to your border/padding of the cells. 同样,可以根据单元格的边框/填充来更改宽度和右侧。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将鼠标悬停在表格单元格html javascript上时会弹出窗口 - popup window when hover over a table cell html javascript 将鼠标悬停在其他div上时,鼠标悬停效果可更改中心div - Mouseover effect to change a center div when mousing over other divs 将鼠标悬停在顶部的对象上时,SVG悬停取消 - SVG hover cancelled when mousing over an object on top 当鼠标悬停时,CSS Navbar下拉菜单文本向左移动 - CSS Navbar dropdown menu text moves to the left when mousing over jQuery悬停/隐藏/显示-将鼠标悬停在多个图像上时,并非所有文本都会正确消失 - jQuery hover/hide/show - not all the text will disappear correctly when mousing over multiple images 当 hover 超过文本时如何更改图像? (严格来说是 HTML、CSS 和 JS) - How to change an image when hover over text? (Strictly HTML, CSS and JS) HTML / CSS / Javascript-将鼠标悬停在另一个单元格上时更改一个表单元格的值 - HTML / CSS / Javascript - Changing one table cell value, when hovering over a different cell 将鼠标悬停在html表格单元格上,并在将鼠标悬停在html表格单元格上时弹出图像,并在光标移开时消失 - Hover over an html table cell and have an image pop-up using javascript while hovering over it and disappear when the cursor is moved away 鼠标悬停在图像上时标签隐藏/显示? - Label Hide/Show when mousing over an image? 将鼠标悬停在joint.js中的链接元素会消失。 - link elements in joint.js dissapear when mousing over them.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM