Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #435
Closed
Open
Issue created Oct 17, 2011 by Administrator@rootContributor

TH elements in tbody are styled incorrectly

Created by: twoolie

putting th elements in tbody (i.e. when you want to have a vertical table of keys and values) are styled with their border-bottom incorrect and incorrect padding.

These style changes in tables.less should fix it.


table {
  width: 100%;
  margin-bottom: @baseline;
  padding: 0;
  border-collapse: separate; // Done so we can round those corners!
  *border-collapse: collapse; /* IE7, collapse table to remove spacing */
  font-size: @basefont;
  border: 1px solid #ddd;
  .border-radius(4px);
  th, td {
    padding: 10px 10px 9px;
    line-height: @baseline;
    text-align: left;
  }
  th {
    font-weight: bold;
    vertical-align: middle;
  }
  thead th {
    padding-top: 9px;
    border-bottom: 1px solid #ddd;
  }
  td {
    vertical-align: top;
  }
  th, td {
    &:not(:first-child) {
      border-left: 1px solid #ddd;
    }
  }
  tr:not(:first-child)
    th, td {
      border-top: 1px solid #ddd;
    }
  }
  tbody {
    tr:first-child {
      th, td {
        &:first-child {
          .border-radius(4px 0 0 0);
        }
        &:last-child {
          .border-radius(0 4px 0 0);
        }
      }
    }
    tr:last-child {
      th, td {
        &:first-child {
          .border-radius(0 0 0 4px);
        }
        td:last-child {
          .border-radius(0 0 4px 0);
        }
      }
    }
  }
}


// ZEBRA-STRIPING
// --------------

// Default zebra-stripe styles (alternating gray and transparent backgrounds)
.zebra-striped {
  tbody {
    tr:nth-child(odd) {
      th, td {
        background-color: #f9f9f9;
      }
    }
    tr:hover {
      th, td {
        background-color: #f5f5f5;
      }
    }
  }
}

Sorry I can't submit a pull, NPM fails on my system so I can't submit compiled .css files as required.

Assignee
Assign to
Time tracking