Trying to use background size cover in a table and not getting the results I am after.
See: http://jsfiddle.net/pp9st63L/1/
.image th {
background-size: cover !important;
height: 300px;
width: auto;
}
The data columns (not including left most column) should be equal width, but the number of columns is variable. Sometimes 3 and other times 4 (including left headline column).
The width of these data columns should be equal and sufficient that the background image can cover. If there is any long data in the other. Currently the width of the columns is purely related to the data in those columns. I would like to override this behavior with CSS and set max widths for columns and make them equal width. So the background-size cover will work.
Any thoughts on how to get this to work?
Just delete
display:blockandmax-width, usewidthfortable cell.background-size:coverworks for me. For some 'beautiful' you may also usebackground-position:50% 50%orbackground-position:50% 0pxforimages. Fortable-cellssamewidthproperties (30% 30% 30%or30px 30px 30px 30px) is a point to set thosewidthalways be the same.P.S. Sorry for my very bad English.
UPD
Also set
widthfor the firstcolExample
UPD 2
Please check, that
tr { td {...} }was error. You should usetr td {...}. Also check, that for set image properties you should usebackground-imageproperty intags. Andwidth:autoI wrote specially to show that you don't need setwidthfor narrow column to set it width to all other space of table. Alsowidthfortable-cellis amin-width. So, text incellscan change thewidth. Butitcould be change by hyphenation (word-wrap).Example 2