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;
}
CommentFileSizeAuthor
#2 added-table-css-2274495-2.patch2.04 KBTehreem Fazili
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tomarnold2’s picture

mattbk, 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.

Tehreem Fazili’s picture

Status: Active » Needs review
FileSize
2.04 KB

Added CSS for the table design in Views.