I have a table with 5 columns (city, 1st quarter, 2nd quarter, 3rd quarter, 4th quarter).
I want that if we already passed a quarter to display an overlay over that quarter's column. My problem is how to make an overlay that covers the whole column. I tried a solution but it would not cover the cell padding. Anybody has an idea how to approach that? Here is my code:
http://jsfiddle.net/7kp3atp7/1/
This is happening because there are spaces between table td. You can either use border-collapse: collapse or modify your current implementation. For example i create an overlay using pseudo-element :after and apply it to all td that has class disable:
/* line 452, ../sass/screen.scss */
.year-calendar {
width: 918px;
margin: 0 auto;
min-height: 260px;
height: auto;
background-color: #ffffff;
border: 8px solid transparent;
padding: 0px;
box-shadow: 1px 1px 30px 1px #adb2b7;
display: block;
border-radius: 8px 8px;
-o-border-radius: 8px 8px;
-ms-border-radius: 8px 8px;
-moz-border-radius: 8px 8px;
-webkit-border-radius: 8px 8px;
}
/* line 463, ../sass/screen.scss */
.year-calendar th, .year-calendar tr {
margin: 0;
padding: 0;
height: 40px;
text-align: center;
}
/* line 470, ../sass/screen.scss */
.year-calendar th {
font-family:"Gotham Medium";
font-size: 15px;
background-color: #0070b9;
border: 0;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
border-top: none;
color: #ffffff;
display: table-cell;
width: 182px;
}
/* line 481, ../sass/screen.scss */
.year-calendar th:first-child {
text-align: left;
border-top-left-radius: 5px;
}
/* line 482, ../sass/screen.scss */
.year-calendar th:last-child {
border-top-right-radius: 5px;
}
/* line 484, ../sass/screen.scss */
.year-calendar td {
border: 0;
width: 182px;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
font-family:"Gotham Medium";
font-size: 13px;
}
/* line 496, ../sass/screen.scss */
.year-calendar tr {
border: 0;
border-top: 1px solid #adb2b7;
border-bottom: 1px solid #adb2b7;
}
/* line 501, ../sass/screen.scss */
.year-calendar tr td:first-child, .year-calendar tr th:first-child {
border-left: none;
}
/* line 502, ../sass/screen.scss */
.year-calendar tr td:last-child, .year-calendar tr th:last-child {
border-right: none;
}
/* line 504, ../sass/screen.scss */
.year-calendar tr:first-child {
border-top: none;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
/* line 509, ../sass/screen.scss */
.year-calendar tr:last-child {
border-bottom: none;
}
/* line 511, ../sass/screen.scss */
.year-calendar tr:last-child td:first-child {
border-bottom-left-radius: 8px;
}
/* line 514, ../sass/screen.scss */
.year-calendar tr:last-child td:last-child {
border-bottom-right-radius: 8px;
}
td, th {
position:relative;
}
td.disable:after {
content:"";
position:absolute;
background-color:black;
display:block;
width:100%;
height:100%;
top:0px;
left: -5px;
padding-left: 4px;
padding-right: 5px;
}
<table class="table year-calendar">
<thead>
<tr>
<th>City</th>
<th><span class="q1"></span>Q1</th>
<th>Q2</th>
<th>Q3</th>
<th>Q4</th>
</tr>
</thead>
<tbody>
<tr>
<td>New York</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
</tr>
<tr>
<td>San Francisco</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="available active">
<input name="" type="checkbox" value="1" checked="checked" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Boston</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Dallas</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Chicago</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
</tbody>
</table>
Or in your example using border-collapse: collapse:
/* line 452, ../sass/screen.scss */
.year-calendar {
width: 918px;
margin: 0 auto;
min-height: 260px;
height: auto;
background-color: #ffffff;
border: 8px solid transparent;
padding: 0px;
box-shadow: 1px 1px 30px 1px #adb2b7;
display: block;
border-radius: 8px 8px;
-o-border-radius: 8px 8px;
-ms-border-radius: 8px 8px;
-moz-border-radius: 8px 8px;
-webkit-border-radius: 8px 8px;
border-collapse: collapse;
}
/* line 463, ../sass/screen.scss */
.year-calendar th,
.year-calendar tr {
margin: 0;
padding: 0;
height: 40px;
text-align: center;
}
/* line 470, ../sass/screen.scss */
.year-calendar th {
font-family: "Gotham Medium";
font-size: 15px;
background-color: #0070b9;
border: 0;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
border-top: none;
color: #ffffff;
display: table-cell;
width: 182px;
}
/* line 481, ../sass/screen.scss */
.year-calendar th:first-child {
text-align: left;
border-top-left-radius: 5px;
}
/* line 482, ../sass/screen.scss */
.year-calendar th:last-child {
border-top-right-radius: 5px;
}
/* line 484, ../sass/screen.scss */
.year-calendar td {
border: 0;
width: 182px;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
font-family: "Gotham Medium";
font-size: 13px;
}
/* line 496, ../sass/screen.scss */
.year-calendar tr {
border: 0;
border-top: 1px solid #adb2b7;
border-bottom: 1px solid #adb2b7;
}
/* line 501, ../sass/screen.scss */
.year-calendar tr td:first-child,
.year-calendar tr th:first-child {
border-left: none;
}
/* line 502, ../sass/screen.scss */
.year-calendar tr td:last-child,
.year-calendar tr th:last-child {
border-right: none;
}
/* line 504, ../sass/screen.scss */
.year-calendar tr:first-child {
border-top: none;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
/* line 509, ../sass/screen.scss */
.year-calendar tr:last-child {
border-bottom: none;
}
/* line 511, ../sass/screen.scss */
.year-calendar tr:last-child td:first-child {
border-bottom-left-radius: 8px;
}
/* line 514, ../sass/screen.scss */
.year-calendar tr:last-child td:last-child {
border-bottom-right-radius: 8px;
}
td,
th {
position: relative;
}
.q1 {
position: absolute;
background-color: black;
display: block;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
}
<table class="table year-calendar">
<thead>
<tr>
<th>City</th>
<th><span class="q1"></span>Q1</th>
<th>Q2</th>
<th>Q3</th>
<th>Q4</th>
</tr>
</thead>
<tbody>
<tr>
<td>New York</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
</tr>
<tr>
<td>San Francisco</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="available active">
<input name="" type="checkbox" value="1" checked="checked" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Boston</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Dallas</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Chicago</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
</tbody>
</table>
Related
I am building a simple calculator using HTML, CSS, and JS. My question is how to remove the padding of the element inside my calculator table.
Visuals
To remove spacing between elements in HTML, googling suggests adding the attributes cellspacing="0" cellpadding="0" to the element, which I did. It also suggests adding a CSS selector table { border-collapse: collapse}. However, border-collapse does not work as I expected: the padding does not get removed, and the table corners become wrecked.
/* Global CSS */
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
--calc-bg: rgb(184, 243, 216);
--btn-bg: rgb(252, 246, 230);
--active-btn-bg: rgb(106, 200, 153);
--main-btn-bg: rgb(71, 202, 143);
--text-color: rgb(45, 53, 44);
--display-bg: rgb(252, 246, 230);
}
/* Calculator CSS */
#import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght#900&display=swap');
.calculator {
font-family: 'Source Code Pro', monospace;
font-weight: 900;
padding: 10px;
border-radius: 2em;
height: 580px;
width: 500px;
margin: auto;
background-color: var(--calc-bg);
border: solid rgb(45, 52, 42) 5px;
-webkit-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
-moz-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
}
.display-box {
background-color: var(--display-bg);
border: solid black 0.5px;
color: black;
border-radius: 1em;
width: 100%;
height: 80px;
-webkit-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
-moz-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
}
#btn {
background-color: var(--main-btn-bg);
}
th,
td {
padding: 0;
}
td {
text-align: center;
vertical-align: middle;
}
input[type=button] {
font-weight: 900;
background-color: var(--btn-bg);
color: var(--text-color);
border: solid rgb(45, 52, 42) 2px;
width: 4rem;
border-radius: 10%;
height: 4rem;
outline: none;
-webkit-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
-moz-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
}
input:active[type=button] {
background: var(--active-btn-bg);
transition-duration: 100ms;
transition-timing-function: ease-out;
<table class="calculator" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> <input class="display-box" type="text" id="result" disabled /> </td>
<!-- clearScreen() function clears all the values -->
<td> <input type="button" value="C" onclick="clearScreen()" id="btn" /> </td>
</tr>
<tr>
<!-- display() function displays the value of clicked button -->
<td> <input type="button" value="1" onclick="display('1')" /> </td>
<td> <input type="button" value="2" onclick="display('2')" /> </td>
<td> <input type="button" value="3" onclick="display('3')" /> </td>
<td> <input type="button" value="/" onclick="display('/')" /> </td>
</tr>
<tr>
<td> <input type="button" value="4" onclick="display('4')" /> </td>
<td> <input type="button" value="5" onclick="display('5')" /> </td>
<td> <input type="button" value="6" onclick="display('6')" /> </td>
<td> <input type="button" value="-" onclick="display('-')" /> </td>
</tr>
<tr>
<td> <input type="button" value="7" onclick="display('7')" /> </td>
<td> <input type="button" value="8" onclick="display('8')" /> </td>
<td> <input type="button" value="9" onclick="display('9')" /> </td>
<td> <input type="button" value="+" onclick="display('+')" /> </td>
</tr>
<tr>
<td> <input type="button" value="." onclick="display('.')" /> </td>
<td> <input type="button" value="0" onclick="display('0')" /> </td>
<!-- calculate() function evaluates the mathematical expression -->
<td> <input type="button" value="=" onclick="calculate()" id="btn" /> </td>
<td> <input type="button" value="*" onclick="display('*')" /> </td>
</tr>
</table>
} ```
Changing the width and height of the table and its elements, along with using border-collapse: collapse and border-spacing: 0 helped to solve the issue
table {
border-collapse: separate;
border-spacing: 0 15px;
}
tr {
border: 1px solid black;
padding: 5px
}
<form>
<table style="background-color: white; border-spacing: ">
<tr>
<td width="167">Input 1:</td>
<td width="140"><input type="text" name="username" required maxlength="18">
</td>
</tr>
<tr>
<td>Input 2:</td>
<td><input type="password" name="password" required></td>
</tr>
</table>
</form>
I am trying to make a good looking table but I've run into a problem. All the people on the internet say that to space the rows I need to set the ' border-collapse: ' to separate. But then the internet people say that to have the rows be in the same border the ' border-collapse: ' needs to be set to collapse. Is there a way to have both? to have the table have separate spaced out rows that have the same column?
_________________
| cell 1 cell 2|
-----------------
_________________
| cell 3 cell 4|
-----------------
like this ^
Here is an other example with border-radius:
table {
border-collapse: separate;
border-spacing: 0;
}
td {
padding: 5px;
border-top: solid 1px #000;
border-bottom: solid 1px #000;
}
td:first-child {
border-left: solid 1px #000;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
td:last-child {
border-right: solid 1px #000;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
tr.spacer td {
border: 0;
padding: 10px;
}
<form>
<table style="background-color: white; border-spacing: ">
<tr>
<td width="167">Input 1:</td>
<td width="140"><input type="text" name="username" required maxlength="18">
</td>
</tr>
<tr class="spacer">
<td colspan="2"></td>
</tr>
<tr>
<td>Input 2:</td>
<td><input type="password" name="password" required></td>
</tr>
</table>
</form>
Just add a new row between them and give it a class like in example and style it as you need.
table {
border-collapse: collapse;
}
tr {
border: 1px solid black;
}
td {
padding: 5px
}
tr.spacer {
border: 0;
}
tr.spacer td {
padding: 15px;
}
<form>
<table style="background-color: white; border-spacing: ">
<tr>
<td width="167">Input 1:</td>
<td width="140"><input type="text" name="username" required maxlength="18">
</td>
</tr>
<tr class="spacer">
<td colspan="2"></td>
</tr>
<tr>
<td>Input 2:</td>
<td><input type="password" name="password" required></td>
</tr>
</table>
</form>
I have a weird question, and perhaps it's more suitable for the CSS fans out there, but why would content inside an absolute positioned div overflow out past everything else?
The example provided here (as a picture) shows that the content overflows out the blue bordered div. The content inside this box should rightfully define the the div's height no? How can this be remedied so that my 'blue' box fits to its content?
Here's the markup in question:
* {
box-sizing: border-box;
font-family: Verdana, Arial, sans-serif;
font-size: 9pt;
}
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 100%;
background: rgb(105, 105, 105);
}
#table-container {
display: table;
text-align: center;
width: 100%;
height: 100%;
}
#container {
display: table-cell;
vertical-align: middle;
}
#wrapper {
padding: 25px;
}
.tabs {
position: relative;
margin: 40px 0 25px;
}
.tab {
float: left;
}
.tab label {
background: rgb(105, 105, 105);
padding: 10px;
border: 1px solid transparent;
color: #FFF;
margin-left: -1px;
position: relative;
left: 1px;
top: -26px;
}
.tab label:hover {
background: #000;
}
.tab [type=radio] {
display: none;
}
.content {
position: absolute;
top: -1px;
left: 0;
background: rgb(222, 222, 222);
right: 0;
bottom: 0;
padding: 20px;
border: 1px solid transparent;
opacity: 0;
color: rgb(58, 58, 58);
}
[type=radio]:checked~label {
background: rgb(222, 222, 222);
font-weight: bold;
border-bottom: 1px solid transparent;
color: #000;
z-index: 2;
}
[type=radio]:checked~label~.content {
z-index: 1;
opacity: 1;
}
/* CSS for Table and Field styling */
.table {
width: 100%;
padding: 0;
margin: 0;
text-align: left;
}
.table td {
border: 1px solid #000;
}
.inputbox {
border: 1px solid rgb(170, 170, 170);
width: 100%;
}
.inputbox:hover {
border: 1px solid rgb(109, 109, 109);
}
.input {
border-style: none;
border-color: inherit;
border-width: 0;
padding: 3px;
height: 20px;
}
input[type="text"],
textarea {
width: 100%;
box-sizing: border-box;
}
.input:focus {
background: rgb(255, 255, 196);
}
<div id="table-container">
<div id="container">
<div id="wrapper">
<div style="border: 1px solid red; text-align: left; font-size: 8pt; color: #fff;">Choose language/Choisissez langue:</div>
<div style="border: 1px solid blue; height: 100%;">
<div class="tabs">
<!-- TAB [1] -->
<div class="tab">
<input type="radio" id="tab-1" name="tab-group-1" checked><label for="tab-1">English</label>
<div class="content">
<table class="table">
<tr>
<td>Traveller's Name:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="tname" class="input" name="Name of Traveler" tabindex="1" /></div>
</td>
<td style="width: 15%;"></td>
<td>Tan #:</td>
<td></td>
</tr>
<tr>
<td>Destination:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="location" class="input" name="Location" tabindex="2" /></div>
</td>
<td></td>
<td>Status:</td>
<td></td>
</tr>
<tr>
<td>iTravel Trip Number:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="location" class="input" name="Location" tabindex="2" /></div>
</td>
<td></td>
<td>Date Issued:</td>
<td>
<div class="inputbox"><input type="text" id="dissued" class="input" disabled/></div>
</td>
</tr>
<tr>
<td>Event Plan ID Code:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="evt-plan-code" class="input" name="Event Plan ID Code" tabindex="4" /></div>
</td>
<td></td>
<td>Issued by:</td>
<td>
<div class="inputbox"><input type="text" id="issuer" class="input" disabled/></div>
</td>
</tr>
<tr>
<td>Dates of Travel</td>
<td>From:</td>
<td>
<div id="ddate" name="Departure Date" tabindex="5"></div>
</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td>To:</td>
<td>
<div id="rdate" name="Return Date" tabindex="6"></div>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Trip Purpose</td>
<td colspan="3"></td>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-2" name="tab-group-1"><label for="tab-2">Français</label>
<div class="content">
tab2
</div>
</div>
</div>
</div>
<div style="border: 1px solid green; text-align: left;">
<input type="button" value="Issue TAN" id="issue">
<input type="button" value="Reset form" id="issue">
<input type="button" value="Save changes" id="issue">
</div>
</div>
<!-- end of div #wrapper -->
</div>
<!-- end of div #container -->
</div>
<!-- end of div #table-container -->
The absolute-positioned div doesn't affect the container div's size since setting position to absolute removes it from the document flow. It's essentially the same behaviour as when position is set to fixed, except it stays at the same place in the page when you scroll. More info can be found here and here.
As for how to fix the height of your div, the short answer is that it can't be done with CSS unless you use a different value for position, perhaps relative in your case but that will depend on the structure of your html. This question covers some other ways that you could go about it.
I'm trying to build my custom radio buttons. I want them to just have a bigger, white border and when the radio button is checked I want to have a white dot in it. Like so:
https://ibb.co/iBjJHk
But it's not working, I can't check the radio button anymore...
I'm searching for a pure CSS solution if possible.
Here is what I tried so far, the relevant part is at the top of the CSS.
https://codepen.io/Insane415/pen/zzoBmp
HTML
<table class="pricing-table">
<tr>
<td id="table-heading"><h1>Leistungen & Preise Telefonservice</h2></td>
<td>
<label for="test">AllIn-Order</label>
<input type="radio" id="test" name="tarif-top">
</td>
<td class="red-background">AllIn-Time<br>
<input type="radio" checked name="tarif-top" value="allin-time"/></td>
<td>AllIn-Contact<br>
<input type="radio" name="tarif-top" value="allin-contact"/></td>
<td>
Enterprise<br>
<input type="radio" name="tarif-top" value="enterprise"/>
</td>
</tr>
<tr>
<td>Monatliche Grundgebühr</td>
<td colspan="3">nur 59,90€</td>
<td>individuell</td>
</tr>
<tr>
<td>Telefonische Annahmezeit</td>
<td colspan="3">Mo-Fr 08:00 bis 19:00 Uhr</td>
<td>24/7</td>
</tr>
<tr>
<td>Kosten pro Minute/Kontakt</td>
<td>0,69€/Minute</td>
<td class="red-background">0,89€/Minute</td>
<td>3,00€/Kontakt</td>
<td>individuell</td>
</tr>
<tr>
<td>Transaktionsgebühren</td>
<td>12,5%/Bestellung</td>
<td class="red-background">—</td>
<td>—</td>
<td>individuell</td>
</tr>
<tr id="services">
<td>Enthaltene Leistungen</td>
</tr>
<tr>
<td>Englischsprachiger Telefonservice</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Kundenservice für Markplätze</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Bestellannahme für Waren</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Anrufnotiz via E-Mail</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Anrufnotiz via E-Mail</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Monatliches Reporting</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Weiterleitung Festnetz (DE)</td>
<td colspan="3">0,09€/Minute</td>
<td>Check</td>
</tr>
<tr>
<td>Weiterleitung Mobilfunknetz (DE)</td>
<td colspan="3">0,25€/Minute</td>
<td>Check</td>
</tr>
<tr>
<td>Buchungsannahme</td>
<td colspan="3">—</td>
<td>Check</td>
</tr>
<tr>
<td>Outbound-Kampagnen</td>
<td colspan="3">—</td>
<td>Check</td>
</tr>
<tr>
<td></td>
<td>
<input type="radio" value="allin-order" name="tarif-bottom"/>
<br>AllIn-Order
</td>
<td class="red-background">
<input type="radio" checked name="tarif-bottom" value="allin-time"/>
<br>AllIn-Time
</td>
<td>
<input type="radio" name="tarif-bottom" value="allin-contact"/>
<br>AllIn-Contact
</td>
<td>
<input type="radio" name="tarif-bottom" value="enterprise"/>
<br>Enterprise
</td>
</tr>
</table>
CSS
/*BEGIN Custom Radio Button*/
#test{
display: none;
}
label:before{
content: '';
width: 25px;
height: 25px;
border: 3px solid white;
display: inline-block;
border-radius: 100%;
position: absolute;
top: 50px;
}
input[type="radio"]:checked + label:after{
content: '';
width: 15px;
height: 15px;
border-radius: 100%;
background-color: white;
display: inline-block;
}
label:hover{
cursor: pointer;
}
/*END Custom Radio Button*/
.pricing-table{
text-align: center;
}
.pricing-table td{
background-color: #ccc;
padding: 12px;
}
.pricing-table tr td:first-child{
background-color: #ddd;
text-align: left;
}
.pricing-table tr td:last-child{
}
.pricing-table tr:last-child td:first-child{
background-color: white;
}
.pricing-table #services td, #table-heading{
font-weight: 600;
background-color: white;
}
.pricing-table tr:first-child td:nth-of-type(1n+2), .pricing-table tr:last-child td {
background-color: #545067;
color: white;
}
.red-background{
color: white!important;
background-color: #E22C26!important;
}
/* BEGIN Radio Buttons*/
/*END Radio Buttons*/
.tarif-choice hr{
border-color: #E22C26;
}
ul.optional {
background-color: #ddd;
padding: 0;
}
ul.optional input{
margin-right: 10px;
margin-left: 15px;
}
ul.optional li{
list-style-type: none;
border-top: 1px solid silver;
}
ul.optional p{
margin-left: 30px;
margin-top: 0;
margin-bottom: 0;
}
ul.optional p:before {
content: "•";
margin-right: 6px;
}
.checkbox-holder{
margin-left: 25px;
}
.checkbox-holder .checkbox-space{
margin-left: 50px;
}
Please see below. Added CSS for label and fixed a few settings for label:after. Since your CSS uses input + label, it is important input is specified before the label in your HTML (changed below).
$('input[type="radio"]').change(function(){
if($(this).val()=='allin-order'){
$(":radio[value=allin-order]").prop("checked", true);
$(".pricing-table td").removeClass("red-background");
$(".pricing-table tr:first-child td:nth-of-type(2)").addClass("red-background");
$(".pricing-table tr:nth-of-type(4) td:nth-of-type(2)").addClass("red-background");
$(".pricing-table tr:nth-of-type(5) td:nth-of-type(2)").addClass("red-background");
$(".pricing-table tr:last-child td:nth-of-type(2)").addClass("red-background");
};
if($(this).val()=='allin-time'){
$(":radio[value=allin-time]").prop("checked", true);
$(".pricing-table td").removeClass("red-background");
$(".pricing-table tr:first-child td:nth-of-type(3)").addClass("red-background");
$(".pricing-table tr:nth-of-type(4) td:nth-of-type(3)").addClass("red-background");
$(".pricing-table tr:nth-of-type(5) td:nth-of-type(3)").addClass("red-background");
$(".pricing-table tr:last-child td:nth-of-type(3)").addClass("red-background");
};
if($(this).val()=='allin-contact'){
$(":radio[value=allin-contact]").prop("checked", true);
$(".pricing-table td").removeClass("red-background");
$(".pricing-table tr:first-child td:nth-of-type(4)").addClass("red-background");
$(".pricing-table tr:nth-of-type(4) td:nth-of-type(4)").addClass("red-background");
$(".pricing-table tr:nth-of-type(5) td:nth-of-type(4)").addClass("red-background");
$(".pricing-table tr:last-child td:nth-of-type(4)").addClass("red-background");
};
if($(this).val()=='enterprise'){
$(":radio[value=enterprise]").prop("checked", true);
$(".pricing-table td").removeClass("red-background");
$(".pricing-table tr:first-child td:nth-of-type(5)").addClass("red-background");
$(".pricing-table tr:nth-of-type(4) td:nth-of-type(5)").addClass("red-background");
$(".pricing-table tr:nth-of-type(5) td:nth-of-type(5)").addClass("red-background");
$(".pricing-table tr:last-child td:nth-of-type(5)").addClass("red-background");
};
});
/*BEGIN Custom Radio Button*/
#test{
display: none;
}
label { display: inline-block; position: relative; }
label:after{
content: '';
width: 25px;
height: 25px;
border: 3px solid white;
border-radius: 50%;
position: absolute;
top: 25px;
right: 25px;
}
input[type="radio"]:checked + label:after{
content: '';
width: 25px;
height: 25px;
border: 3px solid white;
border-radius: 50%;
background: white;
display: inline-block;
}
label:hover{
cursor: pointer;
}
/*END Custom Radio Button*/
.pricing-table{
text-align: center;
}
.pricing-table td{
background-color: #ccc;
padding: 12px;
}
.pricing-table tr td:first-child{
background-color: #ddd;
text-align: left;
}
.pricing-table tr td:last-child{
}
.pricing-table tr:last-child td:first-child{
background-color: white;
}
.pricing-table #services td, #table-heading{
font-weight: 600;
background-color: white;
}
.pricing-table tr:first-child td:nth-of-type(1n+2), .pricing-table tr:last-child td {
background-color: #545067;
color: white;
}
.red-background{
color: white!important;
background-color: #E22C26!important;
}
/* BEGIN Radio Buttons*/
/*END Radio Buttons*/
.tarif-choice hr{
border-color: #E22C26;
}
ul.optional {
background-color: #ddd;
padding: 0;
}
ul.optional input{
margin-right: 10px;
margin-left: 15px;
}
ul.optional li{
list-style-type: none;
border-top: 1px solid silver;
}
ul.optional p{
margin-left: 30px;
margin-top: 0;
margin-bottom: 0;
}
ul.optional p:before {
content: "•";
margin-right: 6px;
}
.checkbox-holder{
margin-left: 25px;
}
.checkbox-holder .checkbox-space{
margin-left: 50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table class="pricing-table">
<tr>
<td id="table-heading"><h1>Leistungen & Preise Telefonservice</h2></td>
<td>
<input type="radio" id="test" name="tarif-top">
<label for="test">AllIn-Order</label>
</td>
<td class="red-background">AllIn-Time<br>
<input type="radio" checked name="tarif-top" value="allin-time"/></td>
<td>AllIn-Contact<br>
<input type="radio" name="tarif-top" value="allin-contact"/></td>
<td>
Enterprise<br>
<input type="radio" name="tarif-top" value="enterprise"/>
</td>
</tr>
<tr>
<td>Monatliche Grundgebühr</td>
<td colspan="3">nur 59,90€</td>
<td>individuell</td>
</tr>
<tr>
<td>Telefonische Annahmezeit</td>
<td colspan="3">Mo-Fr 08:00 bis 19:00 Uhr</td>
<td>24/7</td>
</tr>
<tr>
<td>Kosten pro Minute/Kontakt</td>
<td>0,69€/Minute</td>
<td class="red-background">0,89€/Minute</td>
<td>3,00€/Kontakt</td>
<td>individuell</td>
</tr>
<tr>
<td>Transaktionsgebühren</td>
<td>12,5%/Bestellung</td>
<td class="red-background">—</td>
<td>—</td>
<td>individuell</td>
</tr>
<tr id="services">
<td>Enthaltene Leistungen</td>
</tr>
<tr>
<td>Englischsprachiger Telefonservice</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Kundenservice für Markplätze</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Bestellannahme für Waren</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Anrufnotiz via E-Mail</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Anrufnotiz via E-Mail</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Monatliches Reporting</td>
<td colspan="3">Check</td>
<td>Check</td>
</tr>
<tr>
<td>Weiterleitung Festnetz (DE)</td>
<td colspan="3">0,09€/Minute</td>
<td>Check</td>
</tr>
<tr>
<td>Weiterleitung Mobilfunknetz (DE)</td>
<td colspan="3">0,25€/Minute</td>
<td>Check</td>
</tr>
<tr>
<td>Buchungsannahme</td>
<td colspan="3">—</td>
<td>Check</td>
</tr>
<tr>
<td>Outbound-Kampagnen</td>
<td colspan="3">—</td>
<td>Check</td>
</tr>
<tr>
<td></td>
<td>
<input type="radio" value="allin-order" name="tarif-bottom"/>
<br>AllIn-Order
</td>
<td class="red-background">
<input type="radio" checked name="tarif-bottom" value="allin-time"/>
<br>AllIn-Time
</td>
<td>
<input type="radio" name="tarif-bottom" value="allin-contact"/>
<br>AllIn-Contact
</td>
<td>
<input type="radio" name="tarif-bottom" value="enterprise"/>
<br>Enterprise
</td>
</tr>
</table>
<!-- END table -->
<h2>Buchungsübersicht</h2>
<div class="row">
<div class="col-md-6">
<div class="tarif-choice">
<p>Ihre Tarifauswahl</p>
<hr/>
<div class="allin-time">
<ul>
<li>mtl. Grundgebühr 59,90€</li>
<li>0,89€/Minute</li>
<li>Servicezeit: Mo-Fr 08:00-19:00 Uhr</li>
</ul>
<ul class="check">
<li>Mehrsprachiger Telefonservice</li>
<li>Bestellannahme für Waren</li>
<li>Buchungsannahme</li>
<li>Anrufnotiz via E-Mail</li>
<li>Monatliches Reporting</li>
<li>Einzelverbindungsnachweis</li>
</ul>
</div>
</div>
</div>
<div class="col-md-6">
<p>Optionale Leistungen | | Diese Leistungen werden nur abgerechnet,
soweit Sie sich aktiv für den Service entschieden haben
<ul class="optional">
<li><input type="checkbox"/>Service Zeit 24/7
<p class="dot">Kosten: 19,90 €/E-Mail</p>
</li>
<li><input type="checkbox"/>Anrufnotiz via SMS
<p class="dot">Kosten: 0,20 €/SMS</p>
</li>
<li><input type="checkbox"/>E-Mail-Service
<p class="dot">Servicezeit: Mo-Fr 08:00-19:00 Uhr</p>
<p class="dot">Kosten: 4,49 €/E-Mail</p>
</li>
<li><input type="checkbox"/>Chat-Service
<p class="dot"/>Live-Chat. WhatsApp & Facebook-Messenger Service</p>
<p class="dot"/>Servicezeit: Mo-Fr 08:00-19:00 Uhr</p>
<p class="dot"/>Kosten (2 Abrechnungsmodelle möglich): </p>
<div class="checkbox-holder">
<input type="checkbox"/>5,49€/Chat
<span class="checkbox-space"><input type="checkbox"/>0,69€/Minute</span>
</div>
</li>
<li><input type="checkbox"/>Click-to-Message Service
<p class="dot"/>Servicezeit: Mo-Fr 08:00-19:00 Uhr</p>
<p class="dot">0,20 €/SMS</p>
</li>
</ul>
</div>
</div>
I am creating a table. I want to remove table border line, how do I this?
Here is my code:
<div id="table">
<table class="table table-bordered">
<thead>
<tr>
<th style="text-align:left; width:120px;">Item</th>
<th style="text-align:left; width:200px;">Description</th>
<th style="width:100px;">Unit Cost</th>
<th style="text-align:right; width:60px;">Qty</th>
<th style="text-align:left; width:100px;">Tax</th>
<th style="text-align:left; width:100px;">Tax</th>
<th style="text-align:left; width:100px;">Line Total</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=7 width=800>
<div id="dataRows">
<div class="fieldRow" id="template">
<select class="items" name="items" style="width:127px; float:left;" id="items"> <option value="1" selected="selected" disabled="disabled"></option></select>
<textarea name="description" id="description" class="description" style="float:left; display: block; height: 30px; width:211px; border-radius:0px; margin: -1px 0px 0;"></textarea>
<input type="text" name="unitprice" id="unitprice" class="unitprice" style="float:left; display: block; height: 30px; width:106px; border-radius:0px; margin: -1px 0px 0;">
<input type="text" name="quantity" id="quantity" class="quantity" style="float:left; display: block; height: 30px; width:64px; border-radius:0px; margin: -1px 0px 0;">
<select name="firsttax" id="firsttax" class="firsttax" style=" float:left; display: block; height: 31px; width:107px; border-radius:0px; margin: -2px 0px 0;"><option value="1" selected="selected" ></option></select>
<select name="secondtax" id="secondtax" class="secondtax" style="float:left; display: block; height: 31px; width:104px; border-radius:0px; margin: -2px 0px 0;"><option value="1" selected="selected"></option></select>
<input type="text" name="linetotal" id="linetotal" class="linetotal" placeholder="0.00" readonly style="float:left; display: block; height: 31px; width:104px; border-radius:0px; background-color: #F0F0F0; text-align:right; margin: -2px 0px 0;">
<input type="button" class="button remove" id="btnDel" value="Remove Row" style="float:right; margin:0 -110px; color: #ffffff; background-color: #d9534f; border-color: #d43f3a; padding: 3px 10px; margin-bottom: 0; font-size: 14px; font-weight: normal; line-height: 1.428571429; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; border:1px solid transparent; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none;" />
</div>
</div>
</td>
</tr>
<input type="hidden" id="itemscounter" name="itemscounter" value=""/>
<tr>
<td colspan=7 rowspan=2 width=800 style="border:0px solid white;">
<div style="border:1px solid #DDDDDD; width:317px; height:50px; margin:0 -1px; float:right;">
<label class="required" id="invoicetotal" for="Invoicetotal" style="padding-top:3px;">Invoice Total(USD)</label>
<span style=" font-weight:bold; margin:4px -204px 0; float:right;">$</span>
<input type="text" class="required" id="invoicetotalamount" name="invoicetotalamount" placeholder="0.00" readonly style=" color:#526273; font-weight:bold; text-align:left; border: 0px solid #000000;"/><br>
<label class="required" id="paidtodate" for="paidtodate" style="margin-top: -6px;">Paid to date</label>
<input type="text" class="required" id="paidtodateamount" name="paidtodateamount" placeholder="0.00" style=" color:#526273; font-weight:bold; text-align:right; border: 0px solid #000000;"/>
</div>
<div class="clear"></div>
<div style="border:1px solid #DDDDDD; width:317px; height:33px; margin:50px -316px 0; float:right;">
<label class="required" id="balance" for="balance" style="margin-top:0px;">Balance(USD)</label>
<span style=" font-weight:bold; margin:7px 45px 0; float:left;">$</span>
<input type="text" class="required" id="balanceamount" name="balanceamount" placeholder="0.00" readonly style=" color:#526273; font-weight:bold; text-align:left; border: 0px solid #000000;"/>
</div>
</td>
</tr>
</tbody>
</table>
</div>
and here is my css:
#table{
float: left;
height: 200px;
margin: -291px 19px 0;
width: 825px;
}
and here is screenshot:
use css
it would be
table, th, td
{
border: 0;
}
table
{
border-collapse:collapse;
}
<table border="0" style="width:825px;"> </table>
put border value 0 in css or declare table border like these above i mentioned.. post ur full css code..
Try to use this code:
<table border="0" style="width:825px;border:0px;"> </table>
Try this simple CSS
table.myTable { border:none; }
edit your class and add/change border to zero or try changing into border tag in table.