Responsive table styling
How do I make an responsive table styling?
Responsive table styling using pseudo element. What is a responsive table styling? How do you make a responsive table styling? This script and codes were developed by Camilla Knap on 29 November 2022, Tuesday.
Responsive table styling - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Responsive table styling</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<table> <thead> <tr></tr> <th>Header 1</th> <th>Header 2</th> <th>Header 3</th> <th>Header 4</th> <th>Header 5</th> </thead> <tbody> <tr> <td data-th="Header 1">Table cell 1</td> <td data-th="Header 2">Table cell 2</td> <td data-th="Header 3">Table cell 3</td> <td data-th="Header 4">Table cell 4</td> <td data-th="Header 5">Table cell 5</td> </tr> <tr> <td data-th="Header 1">Table cell 1</td> <td data-th="Header 2">Table cell 2</td> <td data-th="Header 3">Table cell 3</td> <td data-th="Header 4">Table cell 4</td> <td data-th="Header 5">Table cell 5</td> </tr> <tr> <td data-th="Header 1">Table cell 1</td> <td data-th="Header 2">Table cell 2</td> <td data-th="Header 3">Table cell 3</td> <td data-th="Header 4">Table cell 4</td> <td data-th="Header 5">Table cell 5 </td> </tr> </tbody>
</table>
</body>
</html>
Responsive table styling - Script Codes CSS Codes
*, *:before, *:after { box-sizing: border-box;
}
body { margin: 0; font-family: arial; font-size: 14px; background-color: #f5f5f5;
}
table { width: 100%; border-spacing: 0; border-collapse: collapse;
}
tr { border-bottom: 1px solid #000;
}
th { display: table-cell; text-align: left; vertical-align: top; padding: 20px 10px; font-weight: 600;
}
td { display: table-cell; padding: 10px; vertical-align: top;
}
td:before { content: attr(data-th) " "; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; display: inline-block; text-align: left; vertical-align: top; font-weight: 600;
}
@media only screen and (min-width: 641px) { td:before { display: none; }
}
@media only screen and (max-width: 640px) { td { display: -webkit-box; display: -ms-flexbox; display: flex; padding-top: 5px; padding-bottom: 5px; } td:first-child { padding-top: 20px; } td:last-child { padding-bottom: 20px; }
}
@media only screen and (max-width: 640px) { thead { display: none; }
}
Developer | Camilla Knap |
Username | clknap |
Uploaded | November 29, 2022 |
Rating | 3 |
Size | 2,891 Kb |
Views | 10,120 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Input label animation | 3,576 Kb |
Checkbox tag | 2,679 Kb |
Snap animate percentage | 3,545 Kb |
Morph svg icons with greensock | 3,706 Kb |
Css3 loader | 2,391 Kb |
Input label placeholder animation | 3,854 Kb |
CSS only accordion | 5,327 Kb |
Playing around with flexbox grid | 2,363 Kb |
Object-fit cover | 2,249 Kb |
Make links fill out the table cells. | 2,494 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Basic jQuery Filter list | Mtedwards | 2,464 Kb |
Simple, flat contact form | Zeaklous | 2,719 Kb |
See Through | Larrygeams | 77,410 Kb |
Eunice A | Ejbronze | 2,203 Kb |
Carousel Test | Sbirchall | 1,509 Kb |
Lightrays v2 | Sinthetyc | 2,903 Kb |
Starfield old school style | Bolloxim | 5,214 Kb |
Octopus Bar iPad App Interactions | Davidkpiano | 6,735 Kb |
Multi-step GSAP animation | Acacheung | 2,668 Kb |
Update CSS Variables with JS | Wesbos | 2,335 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!