Answer the question
In order to leave comments, you need to log in
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
I figured out what was going on, this line was removed from the page code<!DOCTYPE html>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question