<h2>Responsive Tables #2: Flexbox</h2>

            <th>Type of Food</th>
            <th>Tasty Factor</th>
            <th>Average Price</th>
            <th>Average Rating</th>
            <td>Slice of Pizza</td>
* {
    box-sizing: border-box;
    font-family: "Avenir", "Helvetica", sans-serif;

body {
    background-color: #f9f9f9;

/* Default table styles for this demo */
table {
    border-collapse: collapse;
    text-align: left;
    width: 100%;
table tr {
    background: white;
    border-bottom: 1px solid
table th, table td {
    padding: 10px 20px;

/* Simple CSS for flexbox table on mobile */
@media(max-width: 800px) {
    table thead {
        left: -9999px;
        position: absolute;
        visibility: hidden;
    table tr {
        border-bottom: 0;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        margin-bottom: 40px;
    table td {
        border: 1px solid;
        margin: 0 -1px -1px 0;
        width: 50%;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.