Table Coming in One Column on Mobile
-
Mentioned Page has a table which has 6 columns and i want it look like desktop but with a scroll and fixed header.
The page I need help with: [log in to see the link]
-
Hi,
thanks for your post, and sorry for the trouble.
This one-column layout (called “stacking”) is not done by TablePress, but by another plugin or your theme. Unfortunately, I can’t see what exactly is adding it, due to the CSS minification and caching that your site uses.
If you could temporarily turn that off, I’ll try to find out more.Note that I’m not aware of a method for both horizontal scrolling and fixed header on mobiles at this time 🙁 TablePress does offer some other options via https://tablepress.org/extensions/responsive-tables/ though.
Regards,
TobiasI already 3 tablepress plugins
Thanks But how to overcome or any plugin to get rid of this.Hi,
if you turn off that CSS minification and caching plugin, I can gladly try to find out what’s causing this!
Regards,
Tobiascache n minify css disabled,
Disable the plugin itselfplease check
thanks-
This reply was modified 6 years, 3 months ago by
digitaludit.
Hi,
thanks! That helped a lot! It looks like one of your developers added this feature to some TablePress files. To again remove it, please edit the file
/wp-content/plugins/tablepress/js/jquery.datatables.min.json your server and remove the code fragment
(function () { var headertext = []; var headers = document.querySelectorAll("thead"); var tablebody = document.querySelectorAll("tbody"); for(var i = 0; i < headers.length; i++) { headertext[i]=[]; for (var j = 0, headrow; headrow = headers[i].rows[0].cells[j]; j++) { var current = headrow; headertext[i].push(current.textContent.replace(/\r?\n|\r/,"")); } } if (headers.length > 0) { for (var h = 0, tbody; tbody = tablebody[h]; h++) { for (var i = 0, row; row = tbody.rows[i]; i++) { for (var j = 0, col; col = row.cells[j]; j++) { col.setAttribute("data-th", headertext[h][j]); } } } } } ());from the end of the file.
In addition, please edit the file
/wp-content/tablepress-combined.min.cssand remove the code fragment
@media screen and (max-width: 600px) { table {width:100%;} thead {display: none;} tr:nth-of-type(2n) {background-color: inherit;} tr td:first-child {background: #f0f0f0; font-weight:bold;font-size:1.3em;} tbody td {display: block; text-align:center;} tbody td:before { content: attr(data-th); display: block; text-align:center; }Finally, please go to the “Plugin Options” screen of TablePress and remove the code
@media screen and (max-width:768px) { .tablepress th, .tablepress td { font-size: 10px; } }from the “Custom CSS” text field.
After that, this one-column effect should be turned off again. You might then want to explore one of the other possibilities for a responsive tables, via the Extension from my link above (it is already installed, you will just have to adjust the Shortcode that you are using on that page).
Regards,
Tobiasdid all but still the same issue
coming in one column in mobileHi,
make sure to flush/rebuild the cache of that CSS caching plugin, as it needs to be refreshed after these changes to the original CSS files.
Regards,
Tobiasstill same, pls help
Hi,
from what I can see, your CSS/JS caching plugin still has the code in it, e.g. in /wp-content/cache/min/1/2ec849b5c09d139109b9cb43263936da.js
You will somehow need to flush/clear that cache in your caching plugin.
Regards,
Tobias -
This reply was modified 6 years, 3 months ago by
The topic ‘Table Coming in One Column on Mobile’ is closed to new replies.