Reputation: 797
I have a table as you see in the picture:
What I am trying to do is extend the date row till the end. So, I want blue background for whole row.
Here is my code for this:
<table class="table">
<tbody>
<tr class="list-heading"><td>DATE</td></tr>
<tr v-for="(r, index) in filteredRows.slice(pageStart, pageStart + countOfPage)" class="list-content">
<!-- <th>{{ (currPage-1) * countOfPage + index + 1 }}</th>-->
<td>{{ r.time }}</td>
<td>{{ r.date }}</td>
<td>{{ r.name }}</td>
</tr>
</tbody>
</table>
I am using vue, but I dont think it is related to this. And here is my css:
table .list-heading {
background-color: var(--main-title-color);
color: #FFFFFF;
}
Upvotes: 0
Views: 1415
Reputation: 44
You can try the following code snippet using colspan
<tr class="">
<td colspan="td-number">value</td>
</tr>
tr.list-content{
color: red;
background: blue;
}
Upvotes: -1
Reputation: 313
Try with the td colspan
attribute. Something like this:
<tr class="list-heading"><td colspan="3">DATE</td></tr>
It should expand the td to occupy 3 columns, you may change the number of columns as needed.
Upvotes: 1