1

How do I make a table data only scrollable (Not entire table or row, just one cell)? This is the best I could do, but the display:block; makes all table cells of equal size. (with a different display or no display, a scrollbar appears but is not scrollable as the cell becomes bigger too)

    <table border="1" width="100%" height="100%">
        <tr>
            <td rowspan="2" width="30%" height="10%">

            </td>
            <td width="60%" ><font color="#FFF" style="font-weight:bold">
                <p>Coventry University - CV1 5FB</p>
            </td>
        </tr>

        <tr>
            <td height="90%" style="display:block; overflow-y: scroll; "><font color="#FFF">
                <p>I WANT THIS CELL TO BE SCROLLABLE</p>
            </td>
        </tr>
    </table>    

enter image description here

Salman Fazal
  • 559
  • 7
  • 22
  • http://stackoverflow.com/questions/4050076/how-to-always-show-the-vertical-scrollbar-in-a-browser – RaminS Mar 31 '16 at 01:34
  • ^Well that link answers scrollbars for an entire browser window, this is just a table cell. I have tried combining some of the css together and I failed, thats why I posted this question. – Salman Fazal Mar 31 '16 at 01:38
  • Can you not just put that CSS in your table cell instead of the body? – RaminS Mar 31 '16 at 01:39
  • Thats what I tried, it messes up the table layout then, if the cell is scrollable the cell sizes get incorrect.. – Salman Fazal Mar 31 '16 at 02:37

1 Answers1

1
<table border="1" width="100%" height="100%">
    <tr>
        <td rowspan="2" width="30%" height="10%">

        </td>
        <td width="60%" ><font color="#FFF" style="font-weight:bold">
            <p>Coventry University - CV1 5FB</p>
        </td>
    </tr>

    <tr>
        <td height="90%"><font color="#FFF">
            <p style="display:block; overflow-y: scroll; ">I WANT THIS CELL TO BE SCROLLABLE</p>
        </td>
    </tr>
</table>    

I guess this is what you want; I advise that don't give "td" overflow, but you can add overflow include "td";

John Shang
  • 397
  • 1
  • 8