Tranpose
-
Hi,
How can we transpose a table, ie each element values displayed on a column instead of a row? Ex: a product comparison chart.
The real problem i think is with columnfilter. I would like the same but more like row filter. Is it possible?
-
Hi,
thanks for your question.
There’s no direct “transpose” functionality, but if you use the Responsive Tables Extension from https://tablepress.org/extensions/responsive-tables/ and choose
all
as the value of the Shortcode parameter, the table will be flipped, as seen on that page.Regards,
TobiasHi,
here are my concerns:
– tablepress-datatables-inverted-filter: I can make it work on pages but not on posts (!is_category instead of !is_page).
– tablepress-responsive-tables: I can not make it work. I installed and activated the plug-in, used responsive=”” with all the options but nothing happens. I am using Firefox 24 and IE 11;
– oColumnFilterWidgets.iMaxSelections: I found the constant in ColumnFilterWidgets.js and succesfully changed it to limit the maximum number of selection per drop-down boxes. I am not very familiar with js, so I was wondering what would be the fastest way to turn it into a variable set in in the [table /] tag.Can you help?
Hi,
can you clarify what you mean with make the inverted filter work? If you want this for posts, you’ll not only have to check for
is_category
, but also allow things likeis_single
.About the Responsive Tables: You should try
"all"
as the value, i.e.[table id=123 responsive="all" /]
Note that this might not work in IE out of the box. You might need to modify the conditional comment in the Extension’s PHP code that wraps the included CSS file.
For the ColumnFilterWidgets: To make this option available as a variable, you will need to extend tablepress-datatables-column-filter-widgets.php, in the same way as the “separator” variable there.
Regards,
TobiasI had another question:
is it possible to hide one row or to fix one row dynamically as it is possible to hide a column in the settings?
What I mean: I want to display a row by default and then I want the user to be able to compare the content of this row with other rows, chosen by the user with columnwidget (with one or two tables).Hi,
no, sorry, for that I don’t know a solution ?? This would probably be possible with some custom JavaScript code, but unfortunately, I don’t know how that would need to look like. Sorry.
Regards,
TobiasHi,
For columnwidgetfilters, is it possible to have a link/button to reset all choices?
For responsive table, is there a guidance to customize the table (rown, column size, etc.) as all is inverted? How to force the text to wrap into the cell?Hi,
sorry, unfortunately, I’m not aware of an existing solution to reset the choices for the ColumnFilterWidgets. This should however be possible with some custom JS coding using the library’s API.
For the responsive table, the CSS selectors all remain the same. The “inversion” is only for the display of the table, the internals remain the same. To force the text to wrap, you should simply add a line break manually (i.e. press “Enter” at the desired position in the cell).
Regards,
TobiasHi,
More specifically, I wanted to have an entire column with the same background color. I used:
.tablepress-id-x .column-y {
background-color: #zzz;
}
but only the header changed colors. The cell below remained white.Hi,
that CSS is correct, but please try to extend it to
.tablepress-id-x .column-y { background-color: #zzz !important; }
Regards,
TobiasHi,
When I change the font size in a responsive table, the header column is never aligned with the data columns. It seems to come from a space at the bottom reserved to the pagination, even if it disabled. Is there a way to change that?
Hi,
the pagination should not have an influence on the Responsive Tables Extension, actually… Can you maybe post a link to the page with the table where this happens, so that I can take a direct look? Thanks!
Regards,
TobiasHi,
You can check here “https://www.bigbestlawnmower.com/lawn-equipment-pick-it-now/mower-parts-side-by-side-comparison/”. Look at the tabs (Manual Reel, etc.) where the tables are in responsive mode. Even without style, there is a slight misalignment between the header and the data.
Hi,
from what I can see, this caused by the 1px solid border that you put around each cell in the table (in your theme’s style.css). If you remove that, the table cells should match better.
The other option would be to also add such a border to the header cells.Regards,
TobiasThis is the css part I use:
.tablepress,
.tablepress tr,
.tablepress tbody td,
.tablepress thead th,
.tablepress tfoot th {
border: 1px solid #dddddd;
}
It seems that there is already a border for th, no?I have change the font size to 0.9em. You can see more easily the problem now (same page).
Hi,
ok, it seems to be a
line-height
issue as well. Please try.tablepress, .tablepress tr, .tablepress tbody td, .tablepress thead th, .tablepress tfoot th { border: 1px solid transparent!important; font-size: 1em; line-height: 100%; }
Regards,
Tobias
- The topic ‘Tranpose’ is closed to new replies.