clarkk
clarkk

Reputation: 27689

overflow on table td

How can you put an overflow property on a cell in a table?

http://jsfiddle.net/e8Bxj/

table {
    width:100px;
    height:100px;
}

td.content {
    overflow:auto;
}

<table>
    <tr>
        <td>hmm</td>
    </tr>
    <tr>
        <td class="content">
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
            sadfasf<br>
        </td>
    </tr>
    <tr>
        <td>hmm</td>
    </tr>
</table>

Upvotes: 2

Views: 111

Answers (3)

You knows who
You knows who

Reputation: 895

you just simply add

display:inline-block;

into the td , like this

id.content
{
display:inline-block;
overflow:auto;

}

Upvotes: 1

The Alpha
The Alpha

Reputation: 146191

Try this fiddle

Upvotes: 0

Shawn Taylor
Shawn Taylor

Reputation: 3969

You need to wrap the overflowing content in div.

http://jsfiddle.net/e8Bxj/1/

Upvotes: 2

Related Questions