1

I have a Table that contain a tr in this tr there is several td i need to have overflow-x scroll but it isn't working.

  <tr id="TR_TESTS_BY_CAT" width="100%" height="480px" style="display: none;         overflow-x:scroll">
    <td height="530px" valign="top" id="TD_TESTS1" style="width: 25%">
                                <div id="divTests1" style="height: 530px; width: 100%;  vertical-align: top;">
                                </div>
                            </td>
 <td>.....</td>

.....

but it isn't working

4
  • 1
    a note : overflow-x:scroll is css3, so are you testing in a compatible browser? Commented Jun 22, 2011 at 5:52
  • also place the css in the div Commented Jun 22, 2011 at 5:54
  • is there a way to do it in IE 8 Commented Jun 22, 2011 at 5:58
  • yes sally check my answer below Commented Jun 22, 2011 at 6:06

2 Answers 2

4

overflow is not applicable to <TR>s by definition. TR (display:table-row) is not a block element - does not establish box (remember col/rowspans in cells).

Only block-alike elements (display:block | inline-block | list-item) have concept of overflow as they have box were to scroll.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 for "Only block-alike elements (display:block | inline-block | list-item) have concept of overflow"
0

You can give your td specific sizes: width:200px; this will set the size and the div should also get a width equal or lower, so the there wont be a horizontal scroll.

This is a work around obviously. if you want to get the best solution you can switch to using <div> instead of tables and and avoiding inline css. You can only imagine how much more you can do with css styling.

1 Comment

It would be better to switch my td to <div> :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.