Hello! I have a view that has to be consulted on the mobile. I have this code inserted but if I apply it it also applies to the desktop view.
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px) {
/* 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; }
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;
}
/*
Label the data
*/
td:nth-of-type(1):before { content: "NOMBRE CAMPAÑA"; }
td:nth-of-type(2):before { content: "NOMBRE BONO"; }
td:nth-of-type(3):before { content: "FECHA CREACIÓN"; }
td:nth-of-type(4):before { content: "DATOS USUARIO"; }
td:nth-of-type(5):before { content: "VALIDACIÓN"; }
td:nth-of-type(6):before { content: "ESTADO"; }
}
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
body {
padding: 0;
margin: 0;
width: 320px; }
}
/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
body {
width: 495px;
}
}
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Avansis,
Thank you for getting in touch.
Can you provide a little more clarity on the issue ?
Is it that you are using a table and want this table to be responsive on mobiles?
Please let me know.
Thanks,
Shane
I have this code in css in my view.
But doesn't work fine.
You can see this in:
- /prueba/
In mobile css doesnt work
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Avansis,
I'm unsure of what this css is suppose to do.
Is there a link to where the css originated from where I can have a quick look ? The css is being loaded on the page itself but unsure why its not being applied.
Thanks,
Shane
Hi Shane.
CSS is in view Listado bonos administrador prueba.
I need the table to be put on mobile in two columns. If i remove this:
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px)
CSS apply also in desktop but if i put this css change doesnt apply in mobile.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Avansis,
What I need is the original reference to the css code.
This way I can understand the code in its full context. This snippet without much context to work with won't allow me to help you.
Thanks,
Shane