Table Overflow Handling

If I have a table similar to this very simple example:

table {
    table-layout:fixed;
    width:300px;
}

.td1 {
    width:100px;
}
.td2 {
    width:200px;
}

and in one of mine .td2contains an image that, say, 300pxin width. I would like to show scrollbars so that users can scroll them to see everything. However, I do not think it is possible, right?

So my questions are:

  • Are there other options besides hiddenfor handling table overflows?

  • Is it possible to show scrollbars only if the content exceeds the specified width? (I swear I saw this in some forum software, but I can’t remember which one)

+3
source share
1

overflow: auto

, - .

div div 100% td : auto

<style>
.test { width: 100%; height: 100%; overflow: auto; } 
</style>

<td>
<div class="test">
your image
</div>
</td>
+4

Source: https://habr.com/ru/post/1718456/


All Articles