tags:

views:

53

answers:

2

I have a <table> with table-layout set to fixed, so that all explicit width/height definitions are respected no matter what. I'm trying to get a certain <td> to overflow, but even though I did the table-layout: fixed it doesn't work.

What should I do to make it work?

+1  A: 

It won't work because the <td> will always have the size of an image


You can use height and width attributes. If the image size is 400x300, typing <img src="..." height="100" width="100" /> will show 100x100 image

If you want to crop an image use

<style>
#id{
background:url(...) no-repeat; /* you can use background-position css property here... */
height:100px;
width:100px;
</style>
<div id="image"></div>
Dan
Can I make the image float to fix this?
Pieter
A: 

Using table-layout: fixed, you can only guarantee the column widths, not heights. Also, the content of cells has no bearing on those widths. From w3schools:

The horizontal layout only depends on the table's width and the width of the columns, not the contents of the cells.

How much control do you need over the individual cells? Are you going for hidden overflow or one that can scroll? It's not clear from your question.

DaveS