Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of Creating Responsive Tables</title> <style> table { width: 100%; border-collapse: collapse; } th, td { padding: 8px; text-align: left; border: 1px solid #dee2e6; white-space: nowrap; /* to prevent text wrapping */ } .responsive-table { overflow-x: auto; } </style> </head> <body> <div class="responsive-table"> <table> <thead> <tr> <th>ID</th> <th>Supplier</th> <th>Contact Name</th> <th>Address</th> <th>City</th> <th>Postal Code</th> <th>Country</th> <th>Phone</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Exotic Liquids</td> <td>Charlotte Cooper</td> <td>49 Gilbert St.</td> <td>London</td> <td>EC1 4SD</td> <td>UK</td> <td>(171) 555-2222</td> </tr> <tr> <td>2</td> <td>New Orleans Cajun Delights</td> <td>Shelley Burke</td> <td>P.O. Box 78934</td> <td>New Orleans</td> <td>70117</td> <td>USA</td> <td>(100) 555-4822</td> </tr> <tr> <td>3</td> <td>Grandma Kellys Homestead</td> <td>Regina Murphy</td> <td>707 Oxford Rd.</td> <td>Ann Arbor</td> <td>48104</td> <td>USA</td> <td>(313) 555-5735</td> </tr> <tr> <td>4</td> <td>Tokyo Traders</td> <td>Yoshi Nagase</td> <td>9-8 Sekimai Musashino-shi</td> <td>Tokyo</td> <td>100</td> <td>Japan</td> <td>(03) 3555-5011</td> </tr> <tr> <td>5</td> <td>Mayumis</td> <td>Mayumi Ohno</td> <td>92 Setsuko Chuo-ku</td> <td>Osaka</td> <td>545</td> <td>Japan</td> <td>(06) 431-7877</td> </tr> </tbody> </table> </div> <p><strong>Note:</strong> Toggle the editor layout or open the output in a blank window and resize it to understand how responsive table works.</p> </body> </html>