Search code examples
htmlcss-tables

The middle cell in CSS table is not centered properly


Why the middle cell is not centered when the screen is wide?

I've tried to center almost everithing in ther but still cannot see the results I need.

e

Here is a link: http://edm-norway.com/4d


Solution

  • Use a grid-based CSS framework, like Bootstrap 4:

    <div class="container-fluid grid">
      <div class="row">
        <div class="col-sm-4 column">
          <a href="http://edm-norway.com/4d/logos">our services</a>
        </div>
        <div class="col-sm-4 column">
          <a href="http://mechanisms.club">our project</a></div>
        <div class="col-sm-4 column">
          <a href="http://ecofarm.technology">our startup</a>
        </div>
      </div>
    </div>
    
    <div class="footer">a picture is worth a thousand words
    </div>
    

    See the result I got here. As you can see, on extra small screen resolutions, the blocks stack. You won't be able to stack table cells or headers.

    UPDATE:

    Your Header section should be:

    <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">    
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
      <style>
        body {
          background: #333333ff;
          font-family: 'Poiret One', cursive;
          font-size: 25px;
        }
    
        img {
          display: block;
          margin-left: auto;
          margin-right: auto;
          width: 240px;
          height: auto;
        }
    
        .footer {
          position: fixed;
          left: 0;
          bottom: 0px;
          width: 100%;
          text-align: center;
          color: #f2f2f2ff;
          font-size: 20px;
          background-color: #4a4a4aff;
          padding: 10px;
        }
    
        a,
        a:hover {
          color: #f2f2f2ff;
          text-decoration: none;
        }
    
        .grid .column {
          font-weight: normal;
          text-align: center;
          padding-top: 10px;
          padding-bottom: 10px;
        }
    
        @media (min-width: 576px) {
          .grid .column {
            height: 100px;
          }
        }
    
      </style>
    </head>