Responsive tables below 768px

/* Responsive tables */ @media only screen and (max-width: 768px) { table, table thead, table tbody, table th, table td, table tr { display: block; } table { max-width: 100%; } table tr { border: 0 none; } table td { border: none; border-bottom: 0 none; position: relative; white-space: normal; text-align: left !important; width: auto !important; } }
Break table data into nice rows, on screens width below 768px.

2 Responses

This code is not working, you need to insert max-width:100% to the table
Irq code above works just fine, but I know what you meant. Adding max-width is a good idea. Thanks!

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.