@media print { body{background: white; color: black;} h1{background-color: white; color: black;} th{background-color: white;} } @media (orientation: portrait;) { h1{width: 10em; float: left; backgrond-color: white; padding: 1ex;} } h1 { background-color: #e0ffff; border-style: solid; } body{ background-color: #b0e0e6; } h2 { background-color: #40e0d0; border-style: solid; } table{background: #ffffff; caption-side: top;} table, td{border: 1px solid; } tr {text-align: center;} td:first-child {width: 5ex;} tr:nth-child(1) td:nth-child(2) {background-color:orchid; } tr:nth-child(1) td:nth-child(3) {background-color:red; } tr:nth-child(1) td:nth-child(4) {background-color:aqua; } tr:nth-child(1) td:nth-child(5) {background-color:peru; } tr:nth-child(1) td:nth-child(6) {background-color:lime; }