Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Trick's Responsive Data Table (with inline edit mode) display issue

I am using the guide (click here) written by Chris at CSS-Tricks to create a responsive table. I am also trying to add inline editing to the table.

Plunker Demo

  • The responsiveness works in mobile-screen mode. enter image description here

  • The inline editing works before entering mobile-screen mode. enter image description here

  • It all goes down hill when inline editing is enabled in mobile-screen mode. enter image description here

Main CSS:

/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
    display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
}
tr {
    border: 1px solid #ccc;
}
#demoTable td {
    /* Behave  like a "row" */
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
}
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;
}
like image 640
Dev Avatar asked Jun 29 '26 15:06

Dev


1 Answers

This is coming because when you edit the code td has col-xs-12 div which have float:left, so td not getting proper height.

Try this code:

@media screen only and (max-width:767px){
   #demoTable td .col.col-xs-12 {
      float: none;
      padding: 0;
   }
}
like image 63
Mukesh Ram Avatar answered Jul 02 '26 17:07

Mukesh Ram



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!