Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <br>
  <div class="tableContainer">
    <table>
      <thead>
        <tr>
          <th>Column 1</th>
          <th>Column 2</th>
          <th>Column 3</th>
          <th>Column 4</th>
          <th>Column 5</th>
          <th>Column 6</th>
          <th>Column 7</th>
          <th>Column 8 larger</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Val 1.1</td>
          <td>Val 1.2</td>
          <td>Val 1.3</td>
          <td>Val 1.4</td>
          <td>Val 1.1</td>
          <td>Val 1.2</td>
          <td>Val 1.3</td>
          <td>Val 1.4</td>
        </tr>
        <tr>
          <td>Val 2.1</td>
          <td>Val 2.2</td>
          <td>Val 2.3</td>
          <td>Val 2.4</td>
          <td>Val 2.1</td>
          <td>Val 2.2</td>
          <td>Val 2.3</td>
          <td>Val 2.4</td>
        </tr>
        <tr>
          <td>Also this is a bit larger Val 3.1</td>
          <td>Val 3.2</td>
          <td>Val 3.3</td>
          <td>Val 3.4</td>
          <td>Val 3.1</td>
          <td>Val 3.2</td>
          <td>Val 3.3</td>
          <td>Val 3.4</td>
        </tr>
      </tbody>
    </table>
  </div>
  <br>
   <div class="tableContainerShadow">
    <table>
      <thead>
        <tr>
          <th>Column 1</th>
          <th>Column 2</th>
          <th>Column 3</th>
          <th>Column 4</th>
          <th>Column 5</th>
          <th>Column 6</th>
          <th>Column 7</th>
          <th>Column 8 larger</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Val 1.1</td>
          <td>Val 1.2</td>
          <td>Val 1.3</td>
          <td>Val 1.4</td>
          <td>Val 1.1</td>
          <td>Val 1.2</td>
          <td>Val 1.3</td>
          <td>Val 1.4</td>
        </tr>
        <tr>
          <td>Val 2.1</td>
          <td>Val 2.2</td>
          <td>Val 2.3</td>
          <td>Val 2.4</td>
          <td>Val 2.1</td>
          <td>Val 2.2</td>
          <td>Val 2.3</td>
          <td>Val 2.4</td>
        </tr>
        <tr>
          <td>Also this is a bit larger Val 3.1</td>
          <td>Val 3.2</td>
          <td>Val 3.3</td>
          <td>Val 3.4</td>
          <td>Val 3.1</td>
          <td>Val 3.2</td>
          <td>Val 3.3</td>
          <td>Val 3.4</td>
        </tr>
      </tbody>
    </table>
  </div>
  <br>
</body>
</html>
 
table {
  box-shadow: 0 0 5px rgba(90, 88, 90, 0.3);
 border-collapse: collapse;
}
td, th {
    padding: 10px;
    border: 1px solid rgb(200, 200, 200);
  }
thead>tr {
    background-color: rgb(255, 70, 60);
    color: rgb(255, 255, 255);
  }
tbody>tr {
    &:nth-child(2n+1) {
      background-color: color: rgb(255, 255, 255);
    }
  }
div.tableContainer {
        width: 100%;
}
div.tableContainerShadow {
  width: 100%;
  overflow-x: auto;
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers