G
G
goro322020-04-13 18:50:55
css
goro32, 2020-04-13 18:50:55

The table is not displayed correctly on Iphone how to fix it?

Good afternoon!
I inserted a table on the site, everything works on android, but on the iphone it goes beyond the page boundaries, tell me how to fix it?
What could possibly be the problem?

* {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

.container {
  min-width: 320px;
  max-width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
}

table td, table th {
  padding: 10px;
  border: 1px solid #cbbdbd;
}

tr:nth-child(even){
    background-color: #f0f4c3
    }


@media (max-width: 720px) {

  .container table thead {
    display: none;
  }

  .container table tr {
    display: block;
  }

  .container table td {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
  }

  .container table td::before {
    content: attr(data-label);
    font-weight: bold;
    margin-right: 20px;
  }

}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
goro32, 2020-04-14
@goro32

I figured out what was going on, this line was removed from the page code<!DOCTYPE html>

V
Vladislav, 2020-04-13
@SlavaMaxwell

Hi, try prefixing flexes via autoprefixer in vs code plugin or via node modules autoprefixer plugin for gulp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question