The border disappears when scrolling. I want the border to appear. How can I do this? Or how can I start the scroll only from the scrolled part?
HTML - Table Structure
<div class="wrapper">
<table>
<thead>
<th class='fix'>Fixed</th>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<th>Col 4</th>
<th>Col 5</th>
<th class='fix'>Fixed</th>
</thead>
<tbody>
<tr>
<td class='fix'>First Content</td>
<td>A1</td>
<td>A2 (with longer content)</td>
<td>A3</td>
<td>A4</td>
<td>A5</td>
<td class='fix'>Last Content</td>
</tr>
</tbody>
</table>
</div>
CSS - Table CSS
.wrapper {
overflow-x:scroll;
width:100%;
}
table {
table-layout: fixed;
width: 100%;
border-collapse: collapse;
background: white;
}
thead {
font-family: arial
}
tr {
border-bottom: 1px solid #ccc;
}
td, th {
vertical-align: top;
text-align: left;
width:100px;
padding: 5px;
border: 1px solid red;
}
.fix {
position:sticky;
background: white;
}
.fix:first-child {
left:0;
width:120px;
}
.fix:last-child {
right:0;
width:120px;
}
Play with code: https://jsbin.com/marezen/1/edit?html,css,output
In order to have fixed table borders you need to:
remove border-collapse from css
table {
table-layout: fixed;
width: 100%;
/*border-collapse: collapse;*/
background: white;
}
Also add cellspacing="0" to remove the cellspacing
<table cellspacing="0">
for having same borders like your example, combined with my solution:
CSS-
.wrapper {
overflow-x:scroll;
width:100%;
}
table {
table-layout: fixed;
width: 100%;
/* border-collapse: collapse; */
background: white;
border-top:1px solid red;
/* border-left:1px solid red; */
}
thead {
font-family: arial
}
tr {
/* border-bottom: 1px solid #ccc; */
}
td, th {
vertical-align: top;
text-align: left;
width:100px;
padding: 5px;
/* border: 1px solid red; */
border-right:1px solid red;
border-bottom:1px solid red;
}
.fix {
position:sticky;
background: white;
border-left:1px solid red;
}
.fix:first-child {
left:0;
width:120px;
}
.fix:last-child {
right:0;
width:120px;
}
td:nth-child(6),
th:nth-child(6){
border-right:none;
}
HTML-
<div class="wrapper">
<table cellspacing="0">
<thead>
<th class='fix'>Fixed</th>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<th>Col 4</th>
<th>Col 5</th>
<th class='fix'>Fixed</th>
</thead>
<tbody>
<tr>
<td class='fix'>First Content</td>
<td>A1</td>
<td>A2 (with longer content)</td>
<td>A3</td>
<td>A4</td>
<td>A5</td>
<td class='fix'>Last Content</td>
</tr>
<tr>
<td class='fix'>First Content (with longer content)</td>
<td>B1</td>
<td>B2</td>
<td>B3</td>
<td>B4</td>
<td>B5</td>
<td class='fix'>Last Content</td>
</tr>
<tr>
<td class='fix'>First Content</td>
<td>C1</td>
<td>C2</td>
<td>C3</td>
<td>C4</td>
<td>C5</td>
<td class='fix'>Last Content (with longer content)</td>
</tr>
</tbody>
</table>
</div>
The solution is to add border-left to the wrapper. Then I removed the border property from td, tr and instead added border selection to them like border-top in order to remove the wrapper's border overlapping those borders.
https://jsbin.com/niluyefacu/edit?html,css,output
Related
I would like to collapse only the out-side border, not inside of the thead:
table, tr {
border: 1px solid black;
padding: 7px;
border-collapse: collapse;
}
th {
background: #ccccff;
}
<table>
<thead>
<tr>
<th>Data 1</th>
<th>Data 2</th>
</tr>
</thead>
</table>
will not show the borders between the th like Data 1 | Data 2, why? (And how to add these the border between the th elements)?
Remove border: 1px solid black from table, tr. And set the border for the right side border-right: 1px solid black. Also, using the :last-of-type pseudo-class, remove the border for the last element.
table, tr {
/*border: 1px solid black;*/
padding: 7px;
border-collapse: collapse;
}
th {
background: #ccccff;
border-right: 1px solid black;
}
th:last-of-type {
border-right: unset;
}
<table>
<thead>
<tr>
<th>Data 1</th>
<th>Data 2</th>
<th>Data 3</th>
<th>Data 4</th>
<th>Data 5</th>
<th>Data 6</th>
<th>Data 7</th>
<th>Data 8</th>
<th>Data 9</th>
<th>Data 10</th>
</tr>
</thead>
</table>
border-collapse doesn't have the effect you think. It just prevents gaps between the borders of each cell. This is what happens without border-collapse:
table {
border: 1px solid black;
padding: 7px;
border-collapse: none;
}
th,td {
border: 1px solid blue;
}
<table>
<thead>
<tr>
<th>Data 1</th>
<th>Data 2</th>
</tr>
</thead>
</table>
The other problem is that you are adding the border to the tr - this is just the row, it doesn't apply to the cells inside the row. Also FYI, adding a border to the table in CSS only adds the border around the outside of the whole table.
To apply borders to the cells, you need to add the border CSS to the th elements (and td for the rest of your table), e.g.:
th, td {
border: 1px solid blue;
}
Working Snippet with examples of just rows with borders and th/tds with borders:
table,
tr {
border: 1px solid black;
padding: 7px;
border-collapse: collapse;
text-align:center;
}
th {
border: 1px solid blue;
}
tr.showborder td {
border: 1px solid red;
}
<table>
<thead>
<tr>
<th>Data 1</th>
<th>Data 2</th>
<th>Data 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>this ROW</td>
<td> has a</td>
<td>border</td>
</tr>
<tr>
<td>this ROW</td>
<td> also has a</td>
<td>border</td>
</tr>
<tr class="showborder">
<td>The cells in </td>
<td>this row all</td>
<td>have borders</td>
</tr>
<tr class="showborder">
<td>The cells in </td>
<td>this row all</td>
<td>have borders</td>
</tr>
</tbody>
</table>
I have a table that uses rowspan for one of the table headers. This table also switches to a fixed column style on smaller sizes. The issue I'm running into is on smaller sizes, when the th with the rowspan becomes fixed, it messes up the structure of the remaning th.
A solution I thought of was to just have an empty th above Foods so I didn't have to use a rowspan, but due to ADA requirments, that's not an option.
Here's some code: CODEPEN
This is the large screen view - you can see there's a Foods column as well as two groups, each of which containing two columns.
Here's a view of when it goes to the fixed column layout. You can see that Group 1 - Col 1 now takes the place where Foods used to be, and the entire 2nd shifted.
HTML:
<div class="wrap">
<table>
<thead>
<tr>
<th rowspan="2" class="fixed">Foods</th>
<th colspan="2">Group 1</th>
<th colspan="2">Group 2</th>
</tr>
<tr>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<th>Col 4</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fixed">Tacos</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
</tr>
<tr>
<td class="fixed">Pizza</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
</tr>
</tbody>
</table>
</div>
CSS:
table {
border: solid 1px black;
border-spacing: 0;
border-collapse: collapse;
width: 900px;
}
th {
vertical-align: bottom;
padding: 5px 10px;
border-left: solid 1px grey;
}
th[colspan="2"] {
border-bottom: solid 1px grey;
}
td {
border-top: solid 1px grey;
}
tbody tr:nth-child(odd) td {
background: grey;
}
.fixed {
border-left: none;
}
#media (max-width: 600px) {
.fixed {
position: absolute;
width: 50px;
left: 0;
}
.wrap {
overflow-x: scroll;
overflow-y: visible;
margin-left: 50px;
}
}
I am not really sure about the issue but it seems to be related to the use of position:fixed. You are removing the elements from the flow so it's like they no more belong to the table making the table algorithm behave strange.
An idea of fix is to consider a extra element that you make visible on small screen to avoid this issue. Basically this element will correct the table layout when you make some of the element position:fixed
* {
text-align: center;
font-weight: normal;
}
table {
border: solid 1px black;
border-spacing: 0;
border-collapse: collapse;
width: 900px;
}
th {
vertical-align: bottom;
padding: 5px 10px;
border-left: solid 1px grey;
}
th[colspan="2"] {
border-bottom: solid 1px grey;
}
td {
border-top: solid 1px grey;
}
tbody tr:nth-child(odd) td {
background: grey;
}
.fixed {
border-left: none;
}
.fix {
padding:0;
border:none;
}
#media (min-width:700px) {
.fix {
display:none;
}
}
#media (max-width: 700px) {
.fixed {
position: absolute;
width: 50px;
left: 0;
}
.wrap {
overflow-x: scroll;
overflow-y: visible;
margin-left: 50px;
}
}
<div class="wrap">
<table>
<thead>
<tr>
<th rowspan="2" class="fixed">Foods</th>
<th colspan="2">Group 1</th>
<th colspan="2">Group 2</th>
</tr>
<tr>
<th class="fix"></th>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<th>Col 4</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fixed">Tacos</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
</tr>
<tr>
<td class="fixed">Pizza</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
</tr>
</tbody>
</table>
</div>
To avoid extra element you can consider pseudo element:
* {
text-align: center;
font-weight: normal;
}
table {
border: solid 1px black;
border-spacing: 0;
border-collapse: collapse;
width: 900px;
}
th {
vertical-align: bottom;
padding: 5px 10px;
border-left: solid 1px grey;
}
th[colspan="2"] {
border-bottom: solid 1px grey;
}
td {
border-top: solid 1px grey;
}
tbody tr:nth-child(odd) td {
background: grey;
}
.fixed {
border-left: none;
}
thead > tr:last-child::before {
content:"";
display:table-cell;
padding:0;
border:none;
}
#media (min-width:700px) {
thead > tr:last-child::before {
display:none;
}
}
#media (max-width: 700px) {
.fixed {
position: absolute;
width: 50px;
left: 0;
}
.wrap {
overflow-x: scroll;
overflow-y: visible;
margin-left: 50px;
}
}
<div class="wrap">
<table>
<thead>
<tr>
<th rowspan="2" class="fixed">Foods</th>
<th colspan="2">Group 1</th>
<th colspan="2">Group 2</th>
</tr>
<tr>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<th>Col 4</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fixed">Tacos</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
</tr>
<tr>
<td class="fixed">Pizza</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
<td>blank</td>
</tr>
</tbody>
</table>
</div>
I'm trying to accomplish align numbers horizontally center in the box but with the digits right aligned like in this image:
If you think i should try different method please suggest me.
* {
margin:0;
padding:0;
}
.table{
width: 70px;
border-collapse: collapse;
border-width: 0;
}
th,td {
padding: 2px 5px 2px 5px;
text-align: center;
}
span {
display: inline-block;
text-align: right;
}
<html>
<head>
<link rel="stylesheet" href="check.css">
</head>
<body>
<table class="table">
<thead>
<tr>
<th>Numbers</th>
</tr>
</thead>
<tbody>
<tr>
<td><span>8</span></td>
</tr>
<tr>
<td><span>9</span></td>
</tr>
<tr>
<td><span>10</span></td>
</tr>
<tr>
<td><span>11</span></td>
</tr>
<tr>
<td><span>12</span></td>
</tr>
</tbody>
</table>
</body>
</html>
Number will be dynamic (Between one to four characters)
I added borders so you can see how I did it.
Align the td content to center.
Align the td > span content to right, at give it small width.
* {
margin:0;
padding:0;
}
.table{
width: 70px;
border-collapse: collapse;
border-width: 0;
}
td {text-align: center; border: 1px solid red;}
td span {
padding: 0;
text-align: right;
border: 1px solid blue;
width: 31px;
}
span {
display: inline-block;
text-align: right;
}
<html>
<head>
<link rel="stylesheet" href="check.css">
</head>
<body>
<table class="table">
<thead>
<tr>
<th>Numbers</th>
</tr>
</thead>
<tbody>
<tr>
<td><span>8</span></td>
</tr>
<tr>
<td><span>9</span></td>
</tr>
<tr>
<td><span>10</span></td>
</tr>
<tr>
<td><span>1122</span></td>
</tr>
<tr>
<td><span>112</span></td>
</tr>
</tbody>
</table>
</body>
</html>
In addition to the solution above, I have to say that for this case, it could be a good idea to use a monospace font.
Another option that doesn't need setting explicit size (so will work with any font and/or digits number):
* {
margin:0;
padding:0;
}
.table{
width: 70px;
border-collapse: collapse;
border-width: 0;
}
tbody tr:nth-child(odd) { background: #eee; }
th,td {
padding: 2px 5px 2px 5px;
text-align: right;
}
tbody tr::before, tbody tr::after {
content: '';
display: table-cell;
width: 50%;
}
<html>
<head>
<link rel="stylesheet" href="check.css">
</head>
<body>
<table class="table">
<thead>
<tr>
<th colspan="3">Numbers</th>
</tr>
</thead>
<tbody>
<tr>
<td>8</td>
</tr>
<tr>
<td>9</td>
</tr>
<tr>
<td>10</td>
</tr>
<tr>
<td>11</td>
</tr>
<tr>
<td>12</td>
</tr>
</tbody>
</table>
</body>
</html>
The trick is in adding two "pseudo cells" to each row that take half the available width each.
I went through the same problem and came across the following suggestions which I dont find to be optimal
Use extra padding on both sides of the column (what about responsiveness?)
Use extra columns (semantics anyone?)
Put a table inside a td (performance anyone?)
After going through every nook and corner, I believe I have the optimal solution to this problem
Flexbox to the rescue!!!
Simple trick: Just add a span inside a td that acts as a flexbox container and has 2 span children with both your content pieces inside. Your column could be any size and this still works like a charm!
<style>
*{
margin: 0px;
padding: 0px;
box-sizing: border-box;
font-family: sans-serif;
}
html, body{
width: 100vw;
min-height: 100vh;
}
body{
display: flex;
flex-direction: column;
}
#content{
flex: 1;
display: flex;
flex-direction: row;
}
#left, #right{
flex: 2;
}
#center{
flex: 6;
}
table{
border: 1px solid #ddd;
border-collapse: collapse;
width: 100%;
margin-bottom: 1rem;
}
table th,
table td {
padding: 0.75rem;
vertical-align: top;
border-top: 1px solid #e9ecef;
}
table thead th {
vertical-align: bottom;
border-bottom: 2px solid #e9ecef;
}
td{
text-align: center;
}
span.left{
flex: 1;
background: lightcoral;
text-align: right;
}
span.right{
flex: 1;
background: lightblue;
text-align: left;
}
.flexwrap{
display: flex;
flex-direction: row;
}
</style>
<body>
<div id= "content">
<div id = "left"></div>
<div id = "center">
<table>
<thead>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
<th>Column 6</th>
<th>Column 7</th>
</thead>
<tbody>
<tr>
<td>
1
</td>
<td>Item 1</td>
<td>
<span class="flexwrap">
<span class = 'left'>
13737
</span>
<span class = 'right'>
.9
</span>
</span>
</td>
<td>Table Cell</td>
<td>Table Cell</td>
<td>Table Cell</td>
<td>Table Cell</td>
</tr>
<tr>
<td>
1
</td>
<td>Item 2</td>
<td>
<span class="flexwrap">
<span class = 'left'>
2
</span>
<span class = 'right'>
.34000004
</span>
</span>
</td>
<td>Table Cell</td>
<td>Table Cell</td>
<td>Table Cell</td>
<td>Table Cell</td>
</tr>
</tbody>
</table>
</div>
<div id = "right"></div>
</div>
</body>
I colored the spans so that you can see them in the output. Hope that helps
I want to make a table for foods and nutrition,but there is a problem.No matter what i do width of the<td> and <th> elements won't change...I want my table to look something like this (without the header) Instead of THIS
#table1{
table-layout:fixed;
width:100%;
}
.row1 > th{
border-right:1px solid #ddd;
padding:0.75em;
}
<table id="table1">
<thead>
<tr class="row1">
<th>Foods</th><th>Carbohydrates</th><th>Proteins</th><th>Fats</th><th>Calories Total</th>
</tr>
</thead>
<tbody>
<tr class="row2">
<th>Foods</th><th>Carbohydrates</th><th>Proteins</th><th>Fats</th><th>Calories Total</th>
</tr>
</tbody>
</table>
Thanks.
Ther's no .Table1 class in your html. Simply use .row1 > th
To set width of th you can use:
th:nth-child(1) {
width: 15%;
}
#table1{
table-layout:fixed;
width:100%;
}
.row1 > th{
border-right:1px solid #ddd;
padding:0.75em;
}
.row2 > th{
border-right:1px solid #ddd;
padding:0.75em;
}
th:nth-child(1) {
width: 10%;
}
th:nth-child(2) {
width: 35%;
}
th:nth-child(3) {
width: 15%;
}
th:nth-child(4) {
width: 15%;
}
th:nth-child(5) {
width: 20%;
}
<table id="table1">
<thead>
<tr class="row1">
<th>Foods</th><th>Carbohydrates</th><th>Proteins</th><th>Fats</th><th>Calories Total</th>
</tr>
</thead>
<tbody>
<tr class="row2"><th>Foods</th><th>Carbohydrates</th><th>Proteins</th><th>Fats</th><th>Calories Total</th></tr>
</tbody>
</table>
Is that what you are looking for?
#table1{
table-layout:fixed;
width:100%;
}
.row1 > th, .row2 > td{
border-right:1px solid #ddd;
padding:0.75em;
text-align: left;
}
<table id="table1">
<thead>
<tr class="row1">
<th style="width:40%;">Foods</th>
<th style="width:20%;">Carbohydrates</th>
<th style="width:15%;">Proteins</th>
<th style="width:10%;">Fats</th>
<th style="width:15%;">Calories Total</th>
</tr>
</thead>
<tbody>
<tr class="row2">
<td>Foods</td>
<td>Carbohydrates</td>
<td>Proteins</td>
<td>Fats</td>
<td>Calories Total</td>
</tr>
</tbody>
</table>
I'm trying to style table with what I thought would be a fairly simple style to achieve but have run in to a little issue.
The table will show a coloured indicator on the left hand side of each row so I'm using border-left: 5px solid red; to add it. However, although the border applies - half of it is inside the row and half outside. I've tried adding border-collapse: collapse to no avail, I'm also using box-sizing: border-box but still have the same issue.
Finally, I've also tried adding the border to the first-child cell (td) but the same issue appears.
I've set up an example of what's happening - I've put in an oversized border to highlight the issue:
http://www.cssdesk.com/TVa67
Has anyone run into this before or have any solutions?
body {
background: blue;
}
table {
border-collapse: collapse;
box-sizing: border-box;
table-layout: fixed;
width: 100%;
}
th,
td {
background-color: #fff;
padding: 10px 15px 8px;
}
th {
border-bottom: 1px solid blue;
font-weight: normal;
text-align: left;
}
td {
border-bottom: 1px solid gray;
}
tr.low {
border-left: 25px solid red;
}
<table style="
border-collapse: collapse;
">
<tbody>
<tr>
<th>#</th>
<th>Status</th>
<th>Title</th>
<th>Project</th>
<th>Assigned To</th>
<th>Age</th>
</tr>
<tr class="low">
<td>1</td>
<td>New</td>
<td>This is an example ticket</td>
<td>Something</td>
<td>Something</td>
<td>2 days ago</td>
</tr>
</tbody>
</table>
However, although the border applies - half of it is inside the row
and half outside
This behaviour is expected and is as per specs. Refer to: http://www.w3.org/TR/CSS2/tables.html#collapsing-borders where it says:
Borders are centered on the grid lines between the cells...
It also illustrates that with a diagram with description.
Has anyone run into this before or have any solutions?
Yes, it can be easily demonstrated as in this fiddle: http://jsfiddle.net/abhitalks/xs7L9wn1/1/ and the below Snippet:
* { box-sizing: border-box; }
table {
border-collapse: collapse;
border: 1px solid gray;
table-layout: fixed; width: 70%;
margin: 0 auto;
}
th, td {
border: 1px solid gray;
padding: 6px;
text-align: center;
}
tbody > tr:nth-child(1) > td:first-child { border-left: 16px solid red; }
tbody > tr:nth-child(2) > td:first-child { border-left: 8px solid green; }
tbody > tr:nth-child(3) > td:first-child { border-left: 24px solid blue; }
tbody > tr:nth-child(1) > td:last-child { border-left: 16px solid red; }
tbody > tr:nth-child(2) > td:last-child { border-left: 8px solid green; }
tbody > tr:nth-child(3) > td:last-child { border-left: 24px solid blue; }
<table>
<thead>
<tr>
<th>#</th>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Caption</td>
<td>Description</td>
</tr>
<tr>
<td>2</td>
<td>Caption</td>
<td>Description</td>
</tr>
<tr>
<td>3</td>
<td>Caption</td>
<td>Description</td>
</tr>
</tbody>
</table>
Solution:
Just add a transparent border of the same width to all rows. That way the border-width will be same and it will neatly align. (Update: added a white border-left to first column to hide the hanging border on highlighted cell. As pointed out by your comment.)
th, td { border-left: 15px solid transparent; }
tr > td:first-child, tr > th:first-child { border-left: 5px solid #fff; }
tr.low > td:first-child { border-left: 5px solid red; }
Example Fiddle: https://jsfiddle.net/abhitalks/s9taanz7/5/
Snippet:
* { box-sizing: border-box; }
body { background-color: blue; }
table {
border-collapse: collapse;
table-layout: fixed; width: 100%;
}
th, td {
background-color: #fff;
padding: 10px 15px 8px 8px;
border-left: 5px solid transparent;
border-bottom: 1px solid gray;
}
th {
border-bottom: 1px solid blue;
font-weight: normal; text-align: left;
}
tr > td:first-child, tr > th:first-child { border-left: 10px solid #fff; }
tr.low > td:first-child { border-left: 10px solid red; }
<table>
<thead>
<tr>
<th>#</th>
<th>Status</th>
<th>Title</th>
<th>Project</th>
<th>Assigned To</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr class="">
<td>1</td>
<td>New</td>
<td>This is an example ticket</td>
<td>Something</td>
<td>Something</td>
<td>2 days ago</td>
</tr>
<tr class="low">
<td>2</td>
<td>New</td>
<td>This is an example ticket</td>
<td>Something</td>
<td>Something</td>
<td>2 days ago</td>
</tr>
<tr class="">
<td>3</td>
<td>New</td>
<td>This is an example ticket</td>
<td>Something</td>
<td>Something</td>
<td>2 days ago</td>
</tr>
</tbody>
</table>
However, this approach will have a side-effect of hidden border-bottom because the border-left overlaps it.
Solution 2:
You could have an extra cell on the left to use as indicator. You can then control this by use of colgroup. This approach is neater than above and also requires you to have the width specified only once in css.
Example Fiddle 2: http://jsfiddle.net/abhitalks/z7u1nhwt/1/
Snippet 2:
* { box-sizing: border-box; }
body { background-color: blue; }
table {
border-collapse: collapse;
table-layout: fixed; width: 100%;
}
th, td {
background-color: #fff;
padding: 10px 15px 8px 8px;
border-bottom: 1px solid gray;
}
th {
border-bottom: 1px solid blue;
font-weight: normal; text-align: left;
}
.col1 { width: 10px; }
tr.low > td:first-child {
background-color: #f00;
}
<table>
<colgroup>
<col class="col1" />
<col class="coln" span="6" />
</colgroup>
<thead>
<tr>
<th></th>
<th>#</th>
<th>Status</th>
<th>Title</th>
<th>Project</th>
<th>Assigned To</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr class="">
<td></td>
<td>1</td>
<td>New</td>
<td>This is an example ticket</td>
<td>Something</td>
<td>Something</td>
<td>2 days ago</td>
</tr>
<tr class="low">
<td></td>
<td>2</td>
<td>New</td>
<td>This is an example ticket</td>
<td>Something</td>
<td>Something</td>
<td>2 days ago</td>
</tr>
<tr class="">
<td></td>
<td>3</td>
<td>New</td>
<td>This is an example ticket</td>
<td>Something</td>
<td>Something</td>
<td>2 days ago</td>
</tr>
</tbody>
</table>
And of course, you can also try the approach of using pseudo-element as proposed by #misterManSam, depending on ease of implementation for you.