"No more tables (responsive table)"
Bootstrap 3.3.0 Snippet by geoffk9483

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-sm-12"> <h1 class="text-center"> Customer Order #123456 </h1> </div> <div id="no-more-tables999"> <table class="col-sm-6 table-bordered table-striped table-condensed cf"> <thead class="cf"> <tr> <th colspan="5">Billing Information</th> </tr> </thead> <tbody> <tr> <td colspan="1" ><label for="Billing_Email">Billing Email:</label></td> <td colspan="4" data-title="Billing Email"><input type="text" value="geoffk@aol.com"/></td> </tr> <tr> <td colspan="1" >Name:</td> <td colspan="2" data-title="Billing FName"><input type="text" value="Gregory"/></td> <td colspan="2" data-title="BillingLName"><input type="text" value="Perry"/></td> </tr> <tr> <td colspan="1" >Address1:</td> <td colspan="4" data-title="Billing Address1">123 Main Street</td> </tr> <tr> <td colspan="1" >Address2:</td> <td colspan="4" data-title="Billing Address2">Suite 4546</td> </tr> </tbody> </table> </div> <div id="no-more-tables999"> <table class="col-sm-6 table-bordered table-striped table-condensed cf"> <thead class="cf"> <tr> <th colspan="5">Shipping Information</th> </tr> </thead> <tbody> <tr> <td colspan="1" >Email:</td> <td colspan="4" data-title="ShippingEmail">geoffk@usa.com</td> </tr> <tr> <td colspan="1" >Name:</td> <td colspan="2" data-title="Shipping FName">Geoffrey</td> <td colspan="2" data-title="Shipping LName">King</td> </tr> <tr> <td colspan="1" >Address1:</td> <td colspan="4" data-title="Shippling Address1">123 Main Street</td> </tr> <tr> <td colspan="1" >Address2:</td> <td colspan="4" data-title="Shipping Address2">Suite 4546</td> </tr> </tbody> </table> </div> <div class="col-sm-12"> <h4 class="text-center"> Order Details </h3> </div> <div id="no-more-tables"> <table class="col-sm-12 table-bordered table-striped table-condensed cf"> <thead class="cf"> <tr> <th>Qty</th> <th>Item</th> <th>Description</th> <th>Options</th> <th class="numeric">Price</th> <th class="numeric">Total</th> </tr> </thead> <tbody> <tr> <td data-title="Qty">1</td> <td data-title="Item">AAC</td> <td data-title="Description">Large Brown Saber Sheath</td> <td data-title="Options">Brown, Medium</td> <td data-title="Price" class="numeric">$1.38</td> <td data-title="Total" class="numeric">$5.99</td> </tr> <tr> <td data-title="Qty">1</td> <td data-title="Item">AAD</td> <td data-title="Description">Ames Military Sword</td> <td data-title="Options"> </td> <td data-title="Price" class="numeric">$1.15</td> <td data-title="Total" class="numeric">$1.15</td> </tr> <tr class="hidden-xs"> <td colspan="4"> </td> <th colspan="1">Shipping:</td> <td data-title="Shipping" class="numeric">$1.15</td> </tr> <tr class="hidden-xs"> <td colspan="4"> </td> <th colspan="1">Tax:</td> <td data-title="Tax" class="numeric">$0.15</td> </tr> <tr class="hidden-xs"> <td colspan="4"> </td> <th colspan="1">Order Total:</td> <td data-title="Total" class="numeric">$3.15</td> </tr> </tbody> </table> </div> <div id="no-more-tables9999"> <table class="visible-xs col-sm-12 table-bordered table-striped table-condensed cf"> <tbody> <tr> <td colspan="6"> </td> <th colspan="2">Shipping:</td> <td data-title="Total" class="numeric">$1.15</td> </tr> <tr> <td colspan="6"> </td> <th colspan="2">Tax:</td> <td data-title="Total" class="numeric">$0.15</td> </tr> <tr> <td colspan="6"> </td> <th colspan="2">Order Total:</td> <td data-title="Total" class="numeric">$3.15</td> </tr> </tbody> </table> </div> </div> </div>
@media only screen and (max-width: 800px) { /* Force table to not be like tables anymore */ #no-more-tables table, #no-more-tables thead, #no-more-tables tbody, #no-more-tables th, #no-more-tables td, #no-more-tables tr { display: block; } /* Hide table headers (but not display: none;, for accessibility) */ #no-more-tables thead tr { position: absolute; top: -9999px; left: -9999px; } #no-more-tables tr { border: 1px solid #ccc; } #no-more-tables td { /* Behave like a "row" */ border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50%; white-space: normal; text-align:left; } #no-more-tables td:before { /* Now like a table header */ position: absolute; /* Top/left values mimic padding */ top: 6px; left: 6px; width: 45%; padding-right: 10px; white-space: nowrap; text-align:left; font-weight: bold; } /* Label the data */ #no-more-tables td:before { content: attr(data-title); } }

Related: See More


Questions / Comments: