how to divide row into <td> in responsive table - css

I have a table like this:
+----+----+----+----+----+----+
| A | A | B | B | C | C |
+----+----+----+----+----+----+
And I need to get this result in small screen
+----+----+
| A | A |
+----+----+
| B | B |
+----+----+
| C | C |
+----+----+
Is it possible?
I want to use only css, no jquery.
use display: property, td::after
how should I do ?
How can I solve this?
#media( max-width:640px) {
#test, #test thead, #test tbody {} #test tr {
/* ? */
}
#test th {
/* ? */
}
#test td {
/* ? */
}
#test td::after {
/* ? */
}
#test tr {
border-bottom: 1px solid #ddd;
}
#test th,
#test td {
border-top: none;
border-bottom: none;
}
}
<table id="test" class="table">
<tr>
<th>A</th>
<td>A</td>
<th>B</th>
<td>B</td>
<th>C</th>
<td>C</td>
</tr>
<tr>
<th>D</th>
<td>D</td>
<th>E</th>
<td>E</td>
<th>F</th>
<td>F</td>
</tr>
</table>

<table> and #media are not the best friends.
<div> instead can be both display: block; and display: table; if we want to, so let's rock
jsBin demo
*{box-sizing:border-box;-webkit-box-sizing:border-box;}html,body{height:100%;margin:0;}
.table{
display: table;
width: 100%;
table-layout: fixed;
border-left: 1px solid #444;
border-top: 1px solid #444;
}
.tr{
display: table-row;
}
.td,
.th{
display: table-cell;
background: #eee;
border-bottom: 1px solid #444;
border-right: 1px solid #444;
}
.th{
font-weight: bold;
}
#media(max-width:640px) {
.table,
.tr{
display: block;
}
.th,
.td{
width: 50%;
float: left;
}
}
<div class="table">
<div class="tr">
<div class="th">A</div>
<div class="td">A</div>
<div class="th">B</div>
<div class="td">B</div>
<div class="th">C</div>
<div class="td">C</div>
</div>
<div class="tr">
<div class="th">D</div>
<div class="td">D</div>
<div class="th">E</div>
<div class="td">E</div>
<div class="th">F</div>
<div class="td">F</div>
</div>
</div>

This is using bootstrap:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="row">
<div class="col-md-4 col-xs-12 text-center">
<div class="col-md-2 col-xs-6">A</div>
<div class="col-md-2 col-xs-6">A</div>
</div>
<div class="col-md-4 col-xs-12 text-center">
<div class="col-md-2 col-xs-6">B</div>
<div class="col-md-2 col-xs-6">B</div>
</div>
<div class="col-md-4 col-xs-12 text-center">
<div class="col-md-2 col-xs-6">C</div>
<div class="col-md-2 col-xs-6">C</div>
</div>
</div>
Its better to use <div> rather than using the old <table>. Use a framework like bootstrap, styling would be much easier.

Related

create table from divs with hidden rows with CSS

I have created a table of divs with CSS that is made up of parent rows and child rows, but I want the child rows to make them visible or to hide with the help of vuejs. My problem is not how to make them visible / hidden, how to properly align parents with children.
In my example the child row should fit between parent row two and three, but the child row is displayed above the parent row with the number three.
In the example below the irregularities can be seen much better in full screen mode.
Thanks!
.div-table {
display: table;
width: 100%;
table-layout: auto;
font-size: 12px;
color: black;
}
.div-table-head {
display: table-header-group;
background: #e5e5e5;
vertical-align: middle;
}
.div-table-body {
display: table-row-group;
vertical-align: middle;
}
.div-table-tr {
display: table-row;
}
.div-table-th {
display: table-cell;
font-weight: 700;
text-transform: uppercase;
border-bottom: 3px solid #666;
}
.div-table-td {
display: table-cell;
border-bottom: 1px solid #e5e5e5;
}
.div-table-th, .div-table-td {
padding: 6px;
}
.div-table-tr:nth-of-type(odd) {
background: #f8f8f8;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
}
.div-table-tr:hover {
background: #ffd;
}
.my-material-icons {
font-size: 13px;
color: gray;
cursor: pointer;
}
.col-span {
position: absolute;
padding: 0;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.3.1/css/uikit.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/material-design-icons/3.0.1/iconfont/material-icons.min.css" rel="stylesheet"/>
<div class='div-table'>
<div class='div-table-head'>
<div class='div-table-th' style="width: 3%">#</div>
<div class='div-table-th' >th2</div>
<div class='div-table-th' >th3</div>
</div>
<div class='div-table-body'>
<!-- parent -->
<div class='div-table-tr'>
<div class='div-table-td'>1 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td12</div>
<div class='div-table-td'>td13</div>
</div>
<!-- parent -->
<div class='div-table-tr'>
<div class='div-table-td'>2 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td22</div>
<div class='div-table-td'>td23</div>
</div>
<!-- child -->
<div class='div-table-tr'>
<div class='div-table-td col-span'>
<div class='div-table'>
<div class='div-table-head'>
<div class='div-table-th' style="width: 4%">#</div>
<div class='div-table-th' >th2</div>
<div class='div-table-th' >th3</div>
</div>
<div class='div-table-body'>
<div class='div-table-tr'>
<div class='div-table-td'>1 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td12</div>
<div class='div-table-td'>td13</div>
</div>
<div class='div-table-tr'>
<div class='div-table-td'>2 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td22</div>
<div class='div-table-td'>td23</div>
</div>
</div>
</div>
</div>
</div>
<!-- parent -->
<div class='div-table-tr'>
<div class='div-table-td'>3 <i title="title" class="material-icons my-material-icons">arrow_drop_down_circle</i></div>
<div class='div-table-td'>td32</div>
<div class='div-table-td'>td33</div>
</div>
</div>
</div>
Firts of all instead of use div labels to build a table you should use the vuejs markup https://v2.vuejs.org/v2/examples/grid-component.html

Bootstrap 4 horizontal scroller div

I got this working for Bootstrap 3 but the same code won't work in Bootstrap 4.
Basically, I'm trying to create a horizontal scroll for DIV and here's a working JSFIDDLE for Bootstrap 3 (which I don't want): DEMO
The same code for Bootstrap 4 isn't working though! Here's the JSFiddle for Bootstrap 4: https://jsfiddle.net/6kvw2q5h/
HTML
<div class="live__scroll">
<div class="row text-center">
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
</div>
</div>
CSS
.live__scroll {
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
.live__scroll .live__scroll--box {
display: inline-block;
float: none;
padding: 15px;
border: 1px solid red;
}
What am I doing wrong? I'm at wits end.
HTML
<div class="container testimonial-group">
<div class="row text-center flex-nowrap">
<div class="col-sm-4">1</div>
<div class="col-sm-4">2</div>
<div class="col-sm-4">3</div>
<div class="col-sm-4">4</div>
<div class="col-sm-4">5</div>
<div class="col-sm-4">6</div>
<div class="col-sm-4">7</div>
<div class="col-sm-4">8</div>
<div class="col-sm-4">9</div>
</div>
</div>
CSS
/* The heart of the matter */
.testimonial-group > .row {
overflow-x: auto;
white-space: nowrap;
}
.testimonial-group > .row > .col-sm-4 {
display: inline-block;
float: none;
}
/* Decorations */
.col-sm-4 { color: #fff; font-size: 48px; padding-bottom: 20px; padding-top: 18px; }
.col-sm-4:nth-child(3n+1) { background: #c69; }
.col-sm-4:nth-child(3n+2) { background: #9c6; }
.col-sm-4:nth-child(3n+3) { background: #69c; }
NOTE : codepen
I think you need to remove the flexbox functionality of the .row so add:
.live__scroll .row{
display:block;
}
So it should look like the following:
.live__scroll {
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
.live__scroll .row{
display:block;
}
.live__scroll .live__scroll--box {
display: inline-block;
float: none;
padding: 15px;
border: 1px solid red;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<div class="live__scroll">
<div class="row text-center">
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
<div class="col-8 live__scroll--box">1</div>
</div>
</div>
horizontal scoll bar using bootstrap 4
In table
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>City</th>
<th>Country</th>
<th>Sex</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>bharti</td>
<td>parmar</td>
<td>422</td>
<td>New York</td>
<td>USA</td>
<td>Female</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
</tr>
</tbody>
</table>
In navigation bar
<div class="scrollmenu">
Home
News
Contact
About
Support
Home
News
Contact
About
Support
Home
News
Contact
About
Support
</div>
css code
div.scrollmenu {
background-color: #333;
overflow: auto;
white-space: nowrap;
}
div.scrollmenu a {
display: inline-block;
color: white;
text-align: center;
padding: 14px;
text-decoration: none;
}
div.scrollmenu a:hover {
background-color: #777;
}

Bootstrap rowspan

I have this Bootstrap design,two rows, their columns are class="col-sm-2" and class="col-sm-10".
How can I make the rowspan like in the img below?
Please see this. I have used bootstrap-4.
/*this css is only for identifying row*/
.row > [class^="col-"] {
background-color: rgba(86, 61, 124, 0.15);
border: 1px solid rgba(86, 61, 124, 0.2);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col-2">
1 of 2
</div>
<div class="col-10">
<div class="row">
<div class="col-12">
Level 2
</div>
<div class="col-12">
Level 2
</div>
</div>
</div>
</div>
</div>
yes just easly use bootstrap classe
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-2 col-lg-2" style="background-color: red">
hello
</div>
<div class="col-md-10 col-lg-10" style="background-color: red">
<div class="row">
<div class="col-md-12" style="background-color: black">
<p>a</p>
</div>
<div class="col-md-12" style="background-color: yello">
<p>test</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
I came up with something like this...
<div class="row">
<div class="col-sm-2 left"></div>
<div class="col-sm-10 col-sm-push-2">
<div class="col-sm-12 rightTop"></div>
<div class="col-sm-12 rightBottom"></div>
</div>
</div>
.row {
position: relative;
width: 500px;
margin: 15px auto;
}
.left {
position: absolute;
//left is 15px to negate .row's negative mrgins
left: 15px;
height: 100%;
padding: 0;
background-color: #ff0000;
}
.rightTop, .rightBottom {
height: 50px;
padding: 0;
}
.rightTop {
background-color: #00ff00;
}
.rightBottom {
background-color: #0000ff;
}
codepen example here.
<table width="300" border="1">
<tbody>
<tr>
<td rowspan="2">Merged</td>
<td>Table First Row</td>
</tr>
<tr>
<td>Table Second Row</td>
</tr>
</tbody>

bootstrap 4 nav-tabs stop border-bottom from jumping down on hover

I've tried to incorporate my own style to the nav-tabs in bootstrap 4 because the out-of-the-box does fit my theme very well.
I've got it looking how I want it to, but when I hover over a tab, the border-bottom on the nav-tabs section moves down about 1px. I've tried manipulating the margin, padding, etc but can't seem to figure out how to get it to stop doing it.
Can someone help here?
<div class="container-fluid body-content">
<div class="row">
<div class="col-xs-12 col-sm-3 col-lg-2">
<div class="row m-b-2">
<div class="col-xs-12">
<div class="row m-b-2 left-nav-container">
<div class="col-xs-12">
<div class="row left-nav"><a class="col-xs-6 col-sm-12 left-nav-menu-item" href="#">Update Starters</a>
<a class="col-xs-6 col-sm-12 left-nav-menu-item hidden-xs" href="/rankings/all">Wrestler Rankings</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-9 col-lg-10">
<div class="row">
<div class="col-xs-12">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#roster" role="tab">Roster</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#schedule" role="tab">Schedule</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#elig" role="tab">Eligibility Breakdown</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#depth" role="tab">Depth Chart</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#info" role="tab">Team Info</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane fade in active" id="roster" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Roster</h2>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>Weight</th>
<th>Name</th>
<th>Class</th>
<th>Record</th>
<th>Starter</th>
</tr>
</thead>
<tbody>
<tr style="background-color: lightgray;">
<td>125</td>
<td>#4 Dance, Joey</td>
<td>JR</td>
<td>29 - 3</td>
<td>
<input checked="checked" data-val="true" data-val-required="The Starter field is required." disabled="disabled" id="Wrestlers_0__Starter" name="Wrestlers[0].Starter" style="font-size: large; margin-left: 10px; margin-top: 5px;"
type="checkbox" value="true" />
<input name="Wrestlers[0].Starter" type="hidden" value="false" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="schedule" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Schedule</h2>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Type</th>
<th>Opponent</th>
<th>Comparison</th>
<th>Win</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>11/07/15</td>
<td>Iowa State - Virginia Tech Dual</td>
<td>Dual</td>
<td>
#19 Iowa State
</td>
<td>
Dual Comparison
</td>
<td>W</td>
<td>
32 - 3
</td>
</tr>
<tr>
<td>11/08/15</td>
<td>
Hokie Open
</td>
<td>Tournament</td>
<td>Hokie Open</td>
<td>(NA)</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="elig" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Eligibility Breakdown</h2>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover table-striped table-bordered">
<thead>
<tr>
<th class="text-xs-center elig-header-border">Weight</th>
<th class="text-xs-center elig-header-border">Recruit</th>
<th class="text-xs-center elig-header-border">True Freshman</th>
<th class="text-xs-center elig-header-border">Redshirt Freshman</th>
<th class="text-xs-center elig-header-border">Sophomore</th>
<th class="text-xs-center elig-header-border">Junior</th>
<th class="text-xs-center elig-header-border">Senior</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-xs-center elig-header-border">125</td>
<td class="text-xs-center elig-cell">
<p>Joey Prata</p>
</td>
<td class="text-xs-center elig-cell">
<p>#70 Ryan Haskett</p>
</td>
<td class="text-xs-center elig-cell">
<p></p>
</td>
<td class="text-xs-center elig-cell">
<p></p>
</td>
<td class="text-xs-center elig-cell">
<p>#4 Joey Dance</p>
</td>
<td class="text-xs-center elig-cell">
<p></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="depth" role="tabpanel">
<div class="row">
<div class="col-xs-12">
<div class="card">
<div class="card-heading">
<h2>Depth Chart</h2>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-xl-3">
<div class="card">
<div class="card-heading">
<h3 class="text-xs-center">125</h3>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>Name</th>
<th>Class</th>
<th>Record</th>
</tr>
</thead>
<tbody>
<tr>
<td>#4 Dance Joey</td>
<td>JR</td>
<td class="text-xs-right">29 - 3</td>
</tr>
<tr>
<td>#70 Haskett Ryan</td>
<td>FR</td>
<td class="text-xs-right">4 - 5</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="info" role="tabpanel">
<div class="card">
<div class="card-heading">
<h2>Team Information</h2>
</div>
<div class="card-block">
<form class="form-horizontal" role="form" method="POST" action="Edit">
<input data-val="true" data-val-required="The SchoolId field is required." id="SchoolInfo_SchoolId" name="SchoolInfo.SchoolId" type="hidden" value="74" />
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_SchoolName">SchoolName</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_SchoolName" name="SchoolInfo.SchoolName" readonly="readonly" type="text" value="Virginia Tech" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Aka">Aka</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Aka" name="SchoolInfo.Aka" placeholder="(ie North Dakota State University is NDSU)" type="text" value="" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Nickname">Nickname</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Nickname" name="SchoolInfo.Nickname" type="text" value="Hokies" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Division">Division</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Division" name="SchoolInfo.Division" readonly="readonly" type="text" value="Division I" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_Conference">Conference</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_Conference" name="SchoolInfo.Conference" readonly="readonly" type="text" value="ACC" />
</div>
</div>
<div class="row form-group">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<label class="form-control-label" for="SchoolInfo_TwitterHandle">TwitterHandle</label>
</div>
<div class="col-xs-6 col-sm-8 col-md-4">
<input class="form-control" id="SchoolInfo_TwitterHandle" name="SchoolInfo.TwitterHandle" readonly="readonly" type="text" value="#VT_Wrestling" />
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="validation-summary-valid" data-valmsg-summary="true">
<ul>
<li style="display:none"></li>
</ul>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="hidden-xs-down">
<nav class="navbar navbar-fixed-bottom navbar-dark bg-inverse p-t-1 text-xs-center">
<h6>© 2016 - WrestleStat - ACS, LLC</h6>
</nav>
</footer>
</div>
CSS
body {
padding-top: 70px;
padding-bottom: 20px;
margin-bottom: 60px;
}
/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
max-width: 280px;
}
a {
color: black;
text-decoration: underline;
}
a:hover {
color: red;
}
/* Carousel */
.carousel-caption {
z-index: 10 !important;
}
.carousel-caption p {
font-size: 20px;
line-height: 1.4;
}
#media (min-width: 768px) {
.carousel-caption {
z-index: 10 !important;
}
}
.footer {
position: absolute;
/*bottom: 0;*/
width: 99%;
height: 60px;
line-height: 60px;
background-color: black;
/* #f5f5f5; */
}
.widget {
font-size: .85rem;
padding: .75rem .75rem;
}
.widget-header {
padding: 1rem .75rem .5rem .75rem;
}
.borderless td,
.borderless th {
border: none;
}
.no-underline {
text-decoration: none;
}
/*.card-block-border-bottom {
border-bottom: 1px solid #e5e5e5;
}*/
/* Left Nav stuff */
.left-nav-menu-item {
color: #eceeef;
text-decoration: none;
border-top: .1rem solid white;
background-color: #373a3c;
}
.left-nav {
line-height: 3rem;
}
.left-nav > div:first-of-type {
margin-top: .2rem;
}
a.left-nav-menu-item:hover {
cursor: pointer;
}
a.left-nav-menu-item:hover {
color: red;
text-decoration: none;
}
/* End of left nav */
/* Top nav overrides since Bootstrap 4 isn't complete */
.navbar-brand {
float: none;
margin-top: 1px;
}
.navbar-nav .nav-item {
float: none;
}
.navbar-divider,
.navbar-nav .nav-item + .nav-item,
.navbar-nav .nav-link + .nav-link {
margin-left: 0;
}
#media (min-width: 34em) {
.navbar-brand {
float: left;
}
.navbar-nav .nav-item {
float: left;
}
.navbar-divider,
.navbar-nav .nav-item + .nav-item,
.navbar-nav .nav-link + .nav-link {
margin-left: 1rem;
}
}
.nav.navbar-nav {
padding-top: .3rem;
}
.navbar .navbar-nav .nav-item .nav-link {
text-decoration: none;
}
.navbar .navbar-nav .nav-item .nav-link:hover {
cursor: pointer;
}
.navbar .navbar-nav .nav-item .nav-link.donate {
font-weight: bolder;
color: green;
}
.navbar .navbar-nav .nav-item .nav-link.donate:hover {
color: white;
}
.navbar .navbar-nav .nav-item .dropdown-item {
background-color: #373a3c;
text-decoration: none;
color: #eceeef;
}
.navbar .navbar-nav .nav-item .dropdown-item:hover {
color: #eceeef;
}
/* End of top nav overrides */
/* tab overrides */
.nav.nav-tabs .nav-item a {
text-decoration: none;
}
.nav.nav-tabs a.active {
border: 1px solid black;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background-color: #373a3c;
border-bottom: none;
color: white;
font-weight: bold;
}
.nav.nav-tabs li.nav-item:hover {
border: 1px solid #373a3c;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom: none;
margin-bottom: 0;
padding-bottom: none;
}
.nav.nav-tabs li.nav-item:hover a {
color: black;
}
ul.nav.nav-tabs {
border-bottom: 2px solid #373a3c;
margin-bottom: 1rem;
}
ul.nav.nav-tabs div.tab-content div.card {
border: none;
}
/* end of tab overrides*/
/* eligibility breakdown page */
.elig-header-border {
background-color: lightgray;
}
.elig-border {
border: .1rem solid black;
}
td.elig-cell:hover {
background-color: red;
}
td.elig-cell:hover a:hover {
color: white;
}
/* end of eligibility breakdown */
jsfiddle
How to debug hover states
In order to see what happens when hovering an element, I recommend you to use the "force element state" functionality :hover of Chrome Dev Tools:
Doing that, I can play editing and checking/uncheking stuff to find a solution, then elaborate a CSS correction.
Solution
There's no doubt you have a problem with nested borders. You can use the previous technique to find a cleaner solution, but here is a fast fix:
.nav.nav-tabs li.nav-item {
border: 1px solid transparent;
margin-bottom: -2px !important;
}
.nav.nav-tabs li.nav-item:hover {
border: 1px solid #373a3c !important;
border-bottom: 1px solid transparent !important;
}
.nav.nav-tabs li.nav-item a.nav-link:hover {
border: 1px solid transparent;
border-bottom: none;
}
JSFiddle
Edit
Considering the :focus event, which is triggered when the element gets clicked, you may want to override the default Bootstrap styles for it too.
Add the focus selector .nav.nav-tabs a.active:focus to these styles, so they apply when focusing the element too:
.nav.nav-tabs a.active, .nav.nav-tabs a.active:focus {
border: 1px solid black;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background-color: #373a3c;
border-bottom: none;
color: white;
font-weight: bold;
}
Next to it, you'll want to override the background to keep it white when hovering, even when the element is also focused, so add this:
.nav.nav-tabs a.active:hover {
background-color: #fff;
}
JSFiddle
Here is another solution if you don’t want to add a transparent border but just using padding
Change your the entry .nav.nav-tabs li.nav-item:hover to:
.nav.nav-tabs li.nav-item:hover {
border: 1px solid #373a3c;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom: none;
padding: 0px 0px 0px 0px;
}
and add:
.nav.nav-tabs li.nav-item{
padding: 1px 1px 0px 1px;
}
It should work as expected. JsFiddle

CSS display: table-row-group, to group two table cells together

Does anybody knows how to group two cells of two rows in a table, using CSS display property value table-row-group?
I know that in CSS rowspan doesn't exist but table-row-group is defined to be equivalent to tbody as I can read in this http://www.w3.org/TR/CSS21/tables.html#value-def-table-row-group.
In the following code, I used some divs to create a table using table as CSS display property value. Then in this brand new table, I want to group together the divs having the role of cells, with id row2_cell2 and row3_cell2. I have tried to do it, but, without success, using the value table-row-group of the CSS property display:
<div id='table'>
<div class='row'>
<div class='cell'>
</div>
<div class='cell'>
</div>
</div>
<div class='row_group'>
<div id='row_2' class='row'>
<div class='cell'>
</div>
<div id='row2_cell2' class='cell'>
</div>
</div>
<div id='row_footer' class='row'>
<div class='cell'>
</div>
<div id='row3_cell2' class='cell'>
</div>
</div>
</div>
</div>
Fiddle: http://jsfiddle.net/framj00/2eN3U/
Can you help me please to resolve this problem? many thanks!
table-row-group works only with table element in HTML.So instead of divs use table.You can follow the Fiddle
<html>
<head>
<style>
.black {
border-style: solid;
border-width: 1px;
border-collapse: collapse;
padding: 3px;
}
.tbl { display: table; }
.row { display: table-row; }
.cel { display: table-cell; }
.cpt {
display: table-caption;
text-align: center;
}
.thc {
display: table-cell;
background-color:#f2e8da;
text-align: center;
font-weight: bold;
}
.row:nth-child(odd) { background-color: #def; }
.row:nth-child(even) { background-color: #fff; }
.row:hover {background-color:#f2e8da; }
.tbody { display: table-row-group }
.thead { display: table-header-group }
input {
width: 100%;
background-color: inherit;
}
</style>
</head>
<body>
<div class="tbl black">
<div class="cpt"><input type="search" placeholder="search me"/></div>
<div class="thead">
<div class="row black">
<div class="thc black">name</div>
<div class="thc black">form</div>
</div>
</div>
<div class="tbody" id="data">
<form class="row black">
<div class="cel black">snake<input type="hidden" name="cartitem" value="55"></div>
<div class="cel black"><input name="count" value="1"/></div>
</form>
<form class="row black">
<div class="cel black">snake<input type="hidden" name="cartitem" value="55"></div>
<div class="cel black"><input name="count" value="2"/></div>
</form>
<form class="row black">
<div class="cel black">snake<input type="hidden" name="cartitem" value="55"></div>
<div class="cel black"><input name="count" value="3"/></div>
</form>
</div>
</div>
</body>
</html>

Resources