Grillas CSS abundan y son múltiples sus utilidades (aunque se sigan usando de forma incorrecta y abusando de sus componentes asociados pero enfin, herrar es umano). Vinieron para quedarse por mucho más tiempo y nos han acostumbrado a los layout tan comunes que hoy en día todas nos parecen iguales: 3 columnas, grilla 12 columnas, responsive, líquido… a fin de cuentas todos terminan pareciéndose.
¡Al-2016-todos-los-sitios-se-ven-iguales!
Pero sucedió lo que temía. Llegó cliente -y la diseñadora de cómplice- con un requerimiento que me hizo erizar los pelos: “Jorge, estamos pensando en tener una grilla responsive pero la columna de la derecha tenga un ancho fijo de 200px. Y que en el breakpoint de móviles necesitamos que esta columna desaparezca”.
Grilla Responsive pero con columna fija. OK he visto eso, donde la columna del menú (generalmente de la derecha) tiene ancho fijo y la otra columna de contenido con porcentaje y un margin-left es el ancho de la columna fija.
OK pero esta es responsive. No creo haber visto algo así. Entonces me puse a pensar, prototipar, y encontrar con la solución más crossbrowsing posible, y a continuación les presento lo logrado incluyendo soporte IE8+.
La solución
Preferí utilizar la propiedad CSS display: table;
y sus anexas por el crossbrowsing y porque me permitía principalmente contener un layout fijo/elástico sin añadir mucho código o raros hacks.
HTML:
<div class="table-layout table-fixed">
<!-- left / fluid column-->
<div class="table-cell">
<h1>fluid column</h1>
</div>
<!-- right / fixed column-->
<div class="table-cell fixed-width">
<h1>fixed column: 200px</h1>
</div>
</div>
CSS:
/* la tabla padre, contenedora */
.table-layout {
display: table;
width: 100%;
}
.table-layout.table-fixed {
table-layout: fixed;
}
/* cada celda lateral */
.table-layout .table-cell {
display: table-cell;
width: 100%;
vertical-align: top; /* necesario para Safari y Firefox */
}
.table-layout .fixed-width {
width: 200px; /* el ancho fijo que estimes necesario */
}
EJEMPLO 1
EJEMPLO 2
Agregando la propiedad CSS table-layout: fixed;
pude posicionar un carrusel adentro de un table-cell
sin que se desarmara y se fuera todo al carajo:
EJEMPLO 3
Con una columna fluída y una fija, puedo posicionar en la columna fluída cualquier grilla CSS de las columnas que fueran necesarias:
EJEMPLO 4
Finalmente, esta solución me permitía esconder la columna fija cuando la resolución alcanzara -por ejemplo- el breakpoint de dispositivos móviles:
Comentarios
female viagra pills
how to get viagra where to buy zithromax online purchase retin-a micro finasteride 5mg cost of doxycycline 100mg in india ivermectin 0.1 uk clomid costs australia medicine prednisolone 5mg how much is zithromax buy levitra no prescription
where to get generic viagra
loans for bad credit no guarantor personal lending cash payday loans express loan payday loan no fax low doc loan loan comparison calculator
tadalafil 100 mg uk
where can i buy prednisolone in the uk tretinoin 0.05 cream india stromectol 3 mg price lipitor australia best online pharmacy reddit buy doxycycline 200 mg predinson prescriptions levitra 5mg online synthroid 188 chloroquine prophylaxis
chloroquine 500 mg
prednisolone tablet cost where to purchase clomid amoxicillin mexico buy plaquenil 0 2g resochina northwest pharmacy canada tadalafil 10mg coupon best female viagra over the counter lexapro coupon 20 mg can i buy azithromycin online usa
lenders for bad credit
where can i buy synthroid cheap azithromycin 500mg tablets cost buy cheap viagra online buy chloroquine phosphate online uk sildenafil tablets 120mg
online cash pay day game payday loans pay day loan bad credit loans with no credit check loans online fast loans in california
buy zithromax online paypal
viagra pill for women cheapest doxycycline uk cialis online prescription order albuterol hfa ivermectin 50mg/ml
tretinoin prescription cream zithromax tablets price stromectol 12mg ventolin brand lexapro generic price plaquenil 200 mg prices can you buy prednisone in canada ivermectin 3 mg plaquenil 100mg price cialis uk
prednisolone
cost of 100mg viagra
prednisone buy no prescription buy clomid uk uk tretinoin vardenafil hcl generic cialis nz where to buy sildenafil 50mg purchase viagra online canada express pharmacy tadalafil capsules 10mg levitra uk
personal loans with low interest eagle loan installment loan calculator payday loan consolidation local payday loans payday loans no debit card fast no credit check loans max loan
bad credit personal loans guaranteed approval loan locations cash advance
synthroid generic india azithromycin online how to get viagra over the counter can i buy propecia over the counter uk lipitor 36 plaquenil generic cost cheap doxy doxycycline 20 mg cost retin a cream online uk can you buy zithromax over the counter in australia
how to apply for a loan private lenders for personal loans pay day loan loans online direct lenders cash lenders credit loans online payday advance
instalment loans home equity loan best personal loans loan nguyen loan closing fast loan online loans in nc fast loan with bad credit
tretinoin 0.05 canada
tretinoin cheapest price
private loans
payday cash advance
canadian pharmacy mall buy zithromax in usa average cost of tretinoin tadalafil tablets 20 mg global pharmacy brand synthroid coupon brand name lipitor price zithromax for sale online buy tadalafil us can you buy prednisone without a prescription
cost of doxycycline in india viagra for women price tadalafil generic daily levitra 10 mg online purchase female viagra
tretinoin 0.04 gel
loan scandal
online pharmacy viagra prescription 15mg cialis average cost of doxycycline amoxicillin capsules no prescription viagra for sale in uk cheap
payday personal loans bad credit money loans loan interest rates today loans for women bad credit quick loans advance payday
private loan
loan till payday fast online loans online loans instant approval unsecured loans for bad credit on line payday loans bad credit payday loans lenders direct payday lenders only payday loan apr guarantor loans
prednisone pills cost of lexapro in canada clomid men lexapro 10 mg generic cost propecia singapore brand viagra online pharmacy buy cialis 5mg canada cialis pricing
buy lyrica mexico
how to get zithromax over the counter
1 hour cash loans payday loans for poor credit cash loans no credit check
loans no credit check
fast payday loans online signature loans loan companies payday loan installment loans refinance loan with bad credit apply for loan payday loans in las vegas nevada fast payday loans bad credit
retin a coupon
top mail order pharmacies how much is generic propecia retin a cream price in mexico cialis without a prescription tadalafil 20mg best price