I want to set each element in the first row of my table to have a left border of a certain color and a right border of a certain color. Unfortunately, it looks like the borders of adjacent table cells are overlapping and I only get the left border color showing. The left border is supposed to be light gray and the right side dark gray.
Here is my HTML generating the table. (HTML is generated in cherrypy)
<th id="tbl_head" colspan='4'>%s</th>
<tr>
<td id="colhead">Track</td>
<td id="colhead">Artist</td>
<td id="colhead_time">Time</td>
<td id="colhead">Album</td>
</tr>
Here is my CSS:
table {
font-family: verdana,arial,sans-serif;
font-size:11px;
margin-left: auto;
margin-right: auto;
border-width: 1px;
border-collapse: collapse;
}
td {
padding: 3px;
}
#colhead {
font-weight: bold;
text-align: left;
background-color: #989898;
color: #000000;
border-left-color: #aeaeae;
border-left-style: solid;
border-left-width: 2px;
border-right-color: #6c6c6c;
border-right-style: solid;
border-right-width: 1px;
}
#colhead_time {
font-weight: bold;
text-align: right;
background-color: #989898;
color: #000000;
border-left-color: #aeaeae;
border-left-style: solid;
border-left-width: 2px;
border-right-color: #6c6c6c;
border-right-style: solid;
border-right-width: 1px;
}
Use the below properties on your table CSS.
border-collapse: separate;
border-spacing: 0px;
table {
font-family: verdana, arial, sans-serif;
font-size: 11px;
margin-left: auto;
margin-right: auto;
border-width: 1px;
border-collapse: separate;
border-spacing: 0px;
}
td {
padding: 3px;
}
#colhead {
font-weight: bold;
text-align: left;
background-color: #989898;
color: #000000;
border-left-color: red;
border-left-style: solid;
border-left-width: 2px;
border-right-color: blue;
border-right-style: solid;
border-right-width: 1px;
}
#colhead_time {
font-weight: bold;
text-align: right;
background-color: #989898;
color: #000000;
border-left-color: red;
border-left-style: solid;
border-left-width: 2px;
border-right-color: blue;
border-right-style: solid;
border-right-width: 1px;
}
<table>
<th id="tbl_head" colspan='4'>%s</th>
<tr>
<td id="colhead">Track</td>
<td id="colhead">Artist</td>
<td id="colhead_time">Time</td>
<td id="colhead">Album</td>
</tr>
</table>
Fiddle Demo
In your css, you have added the wrong value for border-color property.
You write it as:
border-right-color: 1px solid #6c6c6c;
while it should be:
border-right-color: #6c6c6c;
It's your use of border-collapse: collapse; use border-spacing:0;border-collapse:no-collapse; instead.
Related
I have explained everything in the attached image. and all CSS code are in the stackblitz.
Basically I want a customized Next and Prev button. I want the border of the Next and Prev button to be same as the inside boxes. and with rounded corner. (that means to show that there is a Prev or Next box still available so use can click on Next/Prev
The problem I am getting now is when I click on the Next/Prev, the border is getting bold and blue. I believe it is coming from the default browser(not sure though)
https://stackblitz.com/edit/primeng-carousel-demo-i1lnft
.p-carousel-prev-icon,
.pi {
display: none !important;
}
.pi {
display: none !important;
}
.pi-chevron-left:before {
content: '' !important;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next::after {
width: 0.513rem;
height: 1.25rem;
font-size: 0.875rem;
font-family: Roboto;
transform: scale(2, 4);
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-prev {
width: 2.513rem;
height: 5.68rem;
border-radius: 25%;
border-right-color: #99bbff;
border-right-style: solid;
border-right-width: thick;
border-top-color: #99bbff;
border-top-style: solid;
border-top-width: thick;
border-bottom-color: #99bbff;
border-bottom-style: solid;
border-bottom-width: thick;
margin: 0 0 0 -5px;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next {
width: 2.513rem;
height: 5.68rem;
border-radius: 25%;
border-left-color: #99bbff;
border-top-color: #99bbff;
border-bottom-color: #99bbff;
border-left-style: solid;
border-top-style: solid;
border-bottom-style: solid;
border-left-width: thin;
border-top-width: thin;
border-bottom-width: thin;
margin: 0 -5px 0 0;
outline: none !important;
}
.p-carousel-next:focus {
border-left-style: solid !important;
border-top-style: solid !important;
border-bottom-style: solid !important;
border-left-width: thin !important;
border-top-width: thin !important;
border-bottom-width: thin !important;
outline: none !important;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next:focus {
border-left-style: solid !important;
border-top-style: solid !important;
border-bottom-style: solid !important;
border-left-width: thin !important;
border-top-width: thin !important;
border-bottom-width: thin !important;
outline: none !important;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next:hover {
border-left-style: solid !important;
border-top-style: solid !important;
border-bottom-style: solid !important;
border-left-width: thin !important;
border-top-width: thin !important;
border-bottom-width: thin !important;
outline: none !important;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next:enabled {
border-left-style: solid !important;
border-top-style: solid !important;
border-bottom-style: solid !important;
border-left-width: thin !important;
border-top-width: thin !important;
border-bottom-width: thin !important;
outline: none !important;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next:enabled:hover {
border-left-style: solid !important;
border-top-style: solid !important;
border-bottom-style: solid !important;
border-left-width: thin !important;
border-top-width: thin !important;
border-bottom-width: thin !important;
outline: none !important;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next:active {
border-left-style: solid !important;
border-top-style: solid !important;
border-bottom-style: solid !important;
border-left-width: thin !important;
border-top-width: thin !important;
border-bottom-width: thin !important;
outline: none !important;
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-prev::after {
width: 0.513rem;
height: 1.25rem;
font-size: 0.875rem;
font-family: Roboto;
transform: scale(2, 4);
}
::ng-deep .p-disabled {
/* visibility: hidden !important; */
border-left-color: white !important;
border-right-color: white !important;
border-top-color: white !important;
border-bottom-color: white !important;
}
There's a box-shadow that is added when the button is focused.
You can remove it with this style:
::ng-deep .p-carousel .p-carousel-content .p-carousel-prev:focus {
box-shadow: none;
}
Also, I think this is what you mentioned in the image, but the previous button have border width set to thick, it should be changed to thin to match the next button:
::ng-deep .p-carousel .p-carousel-content .p-carousel-prev {
width: 2.513rem;
height: 5.68rem;
border-radius: 25%;
border-right-color: #99bbff;
border-right-style: solid;
border-right-width: thin;
border-top-color: #99bbff;
border-top-style: solid;
border-top-width: thin;
border-bottom-color: #99bbff;
border-bottom-style: solid;
border-bottom-width: thin;
margin: 0 0 0 -5px;
}
Here's the updated demo: https://stackblitz.com/edit/primeng-carousel-demo-dbzinn
do you want to keep the blue border ? because this is enough to edit your buttons :
.p-carousel-next, .p-carousel-prev {
box-shadow: none !important;
border-width: 1px !important;
/* if you wish to remove the border or change its color */
/* border: transparent !important; */
}
I'm trying to use a dropdown menu that allows user to check information if the mouse pointer is on the menu. If the user removes the pointer then the dropdown menu will disappear. Everything is in the table.
The problem I have now is, in the very end row, the part of a dropdown menu looks hidden ( to more precisely describe, it looks underneath of other element ).
The image should be preferred being over everything ( I hope so ). I tried to touch z-index but it doesn't work.
<table class="table table-striped table-bordered table-advance table-hover">
<tbody>
<td>
<div class="btn-group">
<div class="btn dropdown-toggle" style=" background-color:#EF4836;color:white; margin:2.5px 0;" data-toggle="dropdown" data-hover="dropdown" data-delay="0" data-close-others="true">
</div>
<ul class="dropdown-menu" role="menu" style="width:300px;">
<span style="background-color: rgb(0, 0, 255);"><font color="#ffffff">Hi!<br></font></span>
<li>Hello Stack Overflow</li>
<li>
Google vs Amazon</li>
</ul>
</div>
</td>
...
The below is the computed CSS property of the drowndown menu in Chrome.
background-color: rgb(239, 72, 54);
background-image: none;
border-bottom-color: rgba(0, 0, 0, 0);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-style: solid;
border-bottom-width: 0px;
border-collapse: collapse;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgba(0, 0, 0, 0);
border-left-style: solid;
border-left-width: 0px;
border-right-color: rgba(0, 0, 0, 0);
border-right-style: solid;
border-right-width: 0px;
border-top-color: rgba(0, 0, 0, 0);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top-style: solid;
border-top-width: 0px;
box-shadow: none;
box-sizing: border-box;
color: rgb(255, 255, 255);
cursor: pointer;
direction: ltr;
display: block;
filter: none;
float: left;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
font-weight: normal;
height: 34px;
line-height: 20px;
margin-bottom: 2.5px;
margin-left: 0px;
margin-right: 0px;
margin-top: 2.5px;
outline-color: rgb(255, 255, 255);
outline-style: none;
outline-width: 0px;
padding-bottom: 7px;
padding-left: 14px;
padding-right: 14px;
padding-top: 7px;
position: relative;
text-align: center;
text-shadow: none;
touch-action: manipulation;
vertical-align: middle;
white-space: nowrap;
width: 115.438px
The below is the computed property of .
border-bottom-color: rgb(221, 221, 221);
border-bottom-style: solid;
border-bottom-width: 1px;
border-collapse: collapse;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(221, 221, 221);
border-left-style: solid;
border-left-width: 1px;
border-right-color: rgb(221, 221, 221);
border-right-style: solid;
border-right-width: 1px;
border-top-color: rgb(221, 221, 221);
border-top-style: solid;
border-top-width: 1px;
box-sizing: border-box;
color: rgb(51, 51, 51);
direction: ltr;
display: table-cell;
font-family: 'Open Sans', sans-serif;
font-size: 13px;
height: 173px;
line-height: 18.5714px;
padding-bottom: 8px;
padding-left: 8px;
padding-right: 8px;
padding-top: 8px;
vertical-align: top;
width: 328px;
Where do I need to see to solve this issue? Please let me know! (: Looking forward to receiving good advice from experts!
Best
I have a very simple table with two columns and two rows, the first column (image) spans over two rows but the problem is that it does create the cell over two rows but does not use the second cell. See the following code and image.
<table border="1">
<tbody>
<tr>
<td rowspan="2"> <img src="images/listentest.jpg"> </td>
<td>PROVIDING COMFORT AND SUPPORT</td>
</tr>
<tr>
<td>In this dialogue, a nurse meets with a worried and anxious client at a cardiac clinic.</td>
</tr>
</tbody>
</table>
Output:
I think there may be some CSS attribute affecting the display. Any idea?
CSS Applied on Table (Computed style from chrome):
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
border-bottom-color: rgb(0, 0, 0);
border-bottom-style: solid;
border-bottom-width: 1px;
border-collapse: collapse;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(0, 0, 0);
border-left-style: solid;
border-left-width: 1px;
border-right-color: rgb(0, 0, 0);
border-right-style: solid;
border-right-width: 1px;
border-top-color: rgb(0, 0, 0);
border-top-style: solid;
border-top-width: 1px;
box-sizing: border-box;
color: rgb(119, 119, 119);
display: block;
font-family: 'Source Sans Pro', sans-serif;
font-size: 17.3333339691162px;
font-stretch: normal;
font-style: normal;
font-variant: normal;
font-weight: 300;
height: 123px;
letter-spacing: -0.260000020265579px;
line-height: 28.6000003814697px;
margin-bottom: 20px;
margin-left: 0px;
margin-right: 0px;
margin-top: 40px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
text-align: right;
vertical-align: baseline;
width: 800px;
CSS Applied on Rows (TR):
background-color: rgb(248, 248, 248);
border-bottom-color: rgb(229, 229, 229);
border-bottom-style: solid;
border-bottom-width: 1px;
border-collapse: collapse;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(119, 119, 119);
border-left-style: none;
border-left-width: 0px;
border-right-color: rgb(119, 119, 119);
border-right-style: none;
border-right-width: 0px;
border-top-color: rgb(229, 229, 229);
border-top-style: solid;
border-top-width: 1px;
box-sizing: border-box;
color: rgb(119, 119, 119);
display: table-row;
font-family: 'Source Sans Pro', sans-serif;
font-size: 17.3333339691162px;
font-stretch: normal;
font-style: normal;
font-variant: normal;
font-weight: 300;
height: 91px;
letter-spacing: -0.260000020265579px;
line-height: 28.6000003814697px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
text-align: right;
vertical-align: baseline;
width: 712px;
This is effecting: vertical-align: baseline;
See DEMO
Values (for table cells)
baseline (and sub, super, text-top, text-bottom, , and ) Align the baseline of the cell with the baseline of all
other cells in the row that are baseline-aligned.
top Align the top padding edge of the cell with the top of the row.
middle Center the padding box of the cell within the row.
bottom Align the bottom padding edge of the cell with the bottom of the row.
More Details
I have a table which I'm trying to apply a background image but it doesn't show. The image path is right ( firebug says image loaded) and the table size is same as image size (156X46px)
HTML:
<!--hazard icons start here -->
<table class="hazard-table">
<tr>
<td> 1 </td>
<td> 1 </td>
<td> 1 </td>
</tr>
<tr>
<td> 1 </td>
<td> 1 </td>
<td> 1 </td>
</tr>
<!-- hazard icons end here -->
</table>
CSS:
table.hazard-table {
background:url('../images/icon-item.png') no-repeat;
width:156px;
height:46px;
border-width: 1px;
border-spacing: 2px;
border-style: solid;
border-color:#ebebeb;
border-collapse: collapse;
background-color: white;
}
table.hazard-table th {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: #ebebeb;
background-color: white;
-moz-border-radius: ;
}
table.hazard-table td {
background-position:30 20 ;
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: #ebebeb;
background-color: white;
-moz-border-radius: ;
}
table.hazard-table {
background:url('../images/icon-item.png') no-repeat;
width:156px;
height:46px;
border-width: 1px;
border-spacing: 2px;
border-style: solid;
border-color:#ebebeb;
border-collapse: collapse;
background-color: white;
}
This :
background-color: white;
override the image with a background of white.
You should do instead :
table.hazard-table {
background:white url('../images/icon-item.png') no-repeat;
width:156px;
height:46px;
border-width: 1px;
border-spacing: 2px;
border-style: solid;
border-color:#ebebeb;
border-collapse: collapse;
}
EDIT :
try this :
table{
.hazard-table {
background:white url("../images/icon-item.png") no-repeat;
width:156px;
height:46px;
border-width: 1px;
border-spacing: 2px;
border-style: solid;
border-color:#ebebeb;
border-collapse: collapse;
th{
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: #ebebeb;
background-color: white;
-moz-border-radius: ;
}
td{
background-position:30 20 ;
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: #ebebeb;
background-color: white;
-moz-border-radius: ;
}
}
}
table.hazard-table td {
background-position:30 20 ;
As a starter, the background-position must be pixels, or "center" etc.
}
table.hazard-table td {
background-position:30px 20px ;
This "might" fix the issue.
Hope this fiddle link will work for you .
table.hazard-table {
/* background:url('../images/icon-item.png') no-repeat 0 0;*/
background:url('http://img.talkandroid.com/uploads/2013/03/wpid-photo-jan-14-2013-1115-am.jpg') no-repeat 0 -550px;
width:156px;
height:46px;
border-width: 1px;
border-spacing: 2px;
border-style: solid;
border-color:#ebebeb;
border-collapse: collapse;
/* background-color: white;*/
}
table.hazard-table th {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: #ebebeb;
background-color: white;
-moz-border-radius: ;
}
table.hazard-table td {
background-position:30 20 ;
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: #ebebeb;
/* background-color: white;*/
-moz-border-radius: ;
}
I'm creating a table to display all my subjects content.
My table td vertical border doesn't appear, below is the css code.
Please help.
table.subjects {
border-width: 1px;
border-spacing: 2px;
border-style: solid;
border-color: gray;
border-collapse: collapse;
background-color: white;}
table.subjects th {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: gray;
background-color: white;
-moz-border-radius: ;}
table.subjects td {
border-width: 1px;
padding: 1px;
border-style: solid;
border-color: gray;
background-color: white;
-moz-border-radius: ;}
in html you shoud set border of attribute of table to 1 . did you do it?
it is solution:
<table border="1">
you can use css class like
.tableborder{
border:1px solid gray;
}