Row and Column Highlighting with CSS Only
How do I make an row and column highlighting with css only?
What is a row and column highlighting with css only? How do you make a row and column highlighting with css only? This script and codes were developed by Chris Coyier on 21 January 2023, Saturday.
Row and Column Highlighting with CSS Only - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Row and Column Highlighting with CSS Only</title> <meta name="viewport" content="width=400px, user-scalable=no"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <main> <table> <thead> <tr> <th></th> <th class="col">50kg</th> <th class="col">55kg</th> <th class="col">60kg</th> <th class="col">65kg</th> <th class="col">70kg</th> </tr> </thead> <tbody> <tr> <th class="row">160cm</th> <td>20</td> <td>21</td> <td>23</td> <td>25</td> <td>27</td> </tr> <tr> <th class="row">165cm</th> <td>18</td> <td>20</td> <td>22</td> <td>24</td> <td>26</td> </tr> <tr> <th class="row">170cm</th> <td>17</td> <td>19</td> <td>21</td> <td>23</td> <td>25</td> </tr> <tr> <th class="row">175cm</th> <td>16</td> <td>18</td> <td>20</td> <td>22</td> <td>24</td> </tr> <tbody> </table>
</main> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Row and Column Highlighting with CSS Only - Script Codes CSS Codes
table { overflow: hidden;
}
td, th { padding: 10px; position: relative; outline: 0;
}
body:not(.nohover) tbody tr:hover { background-color: #ffa;
}
td:hover::after,
thead th:not(:empty):hover::after,
td:focus::after,
thead th:not(:empty):focus::after { content: ''; height: 10000px; left: 0; position: absolute; top: -5000px; width: 100%; z-index: -1;
}
td:hover::after,
th:hover::after { background-color: #ffa;
}
td:focus::after,
th:focus::after { background-color: lightblue;
}
/* Focus stuff for mobile */
td:focus::before,
tbody th:focus::before { background-color: lightblue; content: ''; height: 100%; top: 0; left: -5000px; position: absolute; width: 10000px; z-index: -1;
}
Row and Column Highlighting with CSS Only - Script Codes JS Codes
// whatever kind of mobile test you wanna do.
if (screen.width < 500) { $("body").addClass("nohover"); $("td, th") .attr("tabindex", "1") .on("touchstart", function() { $(this).focus(); });
}
Developer | Chris Coyier |
Username | chriscoyier |
Uploaded | January 21, 2023 |
Rating | 4.5 |
Size | 2,180 Kb |
Views | 4,048 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Slide in from bottom boxes | 3,581 Kb |
Data on Performance Culture | 1,948 Kb |
Starting a React-Powered Comment Form | 5,450 Kb |
Sticky Footer | 2,089 Kb |
Glowing Blue Inputs | 2,475 Kb |
Merging Flexbox Syntaxes | 2,654 Kb |
Three-Line Menu Icon, Various Techniques | 3,015 Kb |
Barberpole Hover Animation | 3,674 Kb |
Basic Example of SVG Line Drawing, Backward and Forward | 2,051 Kb |
Chriscoyier | 3,448 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
Dragonball Dragon Radar | DouglasGlover | 2,157 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
Shape Outside - Polygon | Stacy | 3,954 Kb |
Simple checkbox style | Vncnz | 2,628 Kb |
Filtering with shuffle.js | Deyand | 2,712 Kb |
SlideupBoxes | Gavra | 23,772 Kb |
JS Countdown Timer | Ayoungh | 2,435 Kb |
CSS- UI Element States Pseudo-Classes | Tesla809 | 2,206 Kb |
Review test | Otro_user_gil | 4,054 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!