_elements.tables.scss 582 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Styling for tables. In the textbook, almost all tables display the contents
  3. * of a pandas DataFrame.
  4. *
  5. * [1]: Some tables are very small, so we shouldn't force them to be full-width
  6. * [2]: Add striping to table rows to make them easier to read.
  7. */
  8. table {
  9. /* [1] */
  10. max-width: 100%;
  11. width: initial;
  12. border-collapse: collapse;
  13. border-spacing: 0;
  14. }
  15. table td,
  16. table th {
  17. padding: $spacing-unit-tiny $spacing-unit-small;
  18. border: 1px solid $color-dark-gray;
  19. text-align: right;
  20. }
  21. /* [2] */
  22. table tr:nth-child(2n) {
  23. background-color: $color-light-gray;
  24. }