I have a project with multiple tables. I am trying to get this example to work with one of the tables without effecting all the other tables in the project. https://codepen.io/anon/pen/bNBLGo
I tried adding a class name to the css. However, it does effect all the tables in the project. Which I don't want, and I only want it to effect the table who I am using the class name.
CSS
.mytable {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
border: 2px solid black;
}
.mytable thead, tbody, tr, td, th { display: block; }
.mytable tr:after {
content: ' ';
display: block;
visibility: hidden;
clear: both;
}
.mytable thead th {
height: 30px;
line-height: 30px;
/*text-align: left;*/
}
.mytable tbody {
height: 100px;
overflow-y: auto;
}
.mytable thead {
/* fallback */
width: 97%;
/* minus scroll bar width */
width: calc(100% - 17px);
}
.mytable tbody { border-top: 2px solid black; }
.mytable tbody td, thead th {
width: 19.2%;
float: left;
border-right: 1px solid black;
}
.mytable tbody td:last-child, thead th:last-child {
border-right: none;
}
I am referring to the table like
<table class="mytable">
How can i fix this css in that it doesnt effect all the tables in the project, and just the one specifying the css class name?
Thank you