1
I have a table in HTML using Bootstrap:
With the code in CSS below I get it to automatically hide fields the last 3 columns when the page is resized to a resolution of 600 (width):
<style>
@media screen and (max-width: 600px) {
table th:nth-child(3),table th:nth-child(4),table th:nth-child(5) {
display: none;
}
table td:nth-child(3),table td:nth-child(4),table td:nth-child(5) {
display: none;
}
}
</style>
Thus remaining:
But I’d like it to stay that way:
And when I just clicked on + stay that way:
Have to do with bootstrap or javascript?
I believe you will be able to do this with javascript. Because Bootstrap as far as I know does not work with click event.
– Diemano Nóbrega
@Diemanonóbrega Can be in javascript even
– Gleyson Silva
@Diemanonóbrega, Bootstrap is a library using Jquery, which is a library for javascript
– Murilo Melo
@Gleysonsilva, I believe that it will not be possible the way you want, what can be done is, create a modal, that when clicking on the "+" button will bring in itself a copy of the hidden data of the table
– Murilo Melo
@True diemanonóbrega, ended up being redundant.
– Gleyson Silva
@Murilogambôa good idea I will try like this, however, I thought of the other way for finding it easier to implement, of course, if there was a way for him to change the table without me having to make code for every table I have in the system.
– Gleyson Silva