Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to create a Views table and found that there was no CSS for the table design.
As a basis, I copied the following from another theme into the page.css file, but this should really be tweaked and added to the correct CSS file.
table {
margin: 0 0 1.5em;
width: 100%;
border:1px solid #ddd;
border-right:none;
background:#fff;
}
th {
font-weight: bold;
padding:10px 10px;
background:#555;
color:#fff;
}
tr{
padding:5px 5px;
}
td{
padding:5px 10px;
border-top:1px solid #ddd;
border-right:1px solid #ddd;
}
Comment | File | Size | Author |
---|---|---|---|
#2 | added-table-css-2274495-2.patch | 2.04 KB | Tehreem Fazili |
Comments
Comment #1
tomarnold2 CreditAttribution: tomarnold2 commentedmattbk, this was super helpful. Thank you. I made the above change and it looks much, much better now.
My impression was that in D8 the way to do this is to create a new .twig based on the needed template. So, I went and created a views-view-table.html.twig file and placed it in the zircon/templates/views directory with no success. So, very happy to have found your solution.
Comment #2
Tehreem Fazili CreditAttribution: Tehreem Fazili at Axelerant for Drupal India Association commentedAdded CSS for the table design in Views.