Why doesn't table resize work here? jsfiddle url inserted

149 views Asked by At

How can I make my table resizable like a textarea element and not individual rows/columns? I seem to be fundamentally missing something simple.

https://jsfiddle.net/o0Ldf0us/

<table id="example">
<thead>
    <tr>
        <th>Heading1</th>
        <th>Heading2</th>
        <th>Heading3</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>Data1.1</td>
        <td>Data1.2</td>
        <td>Data1.3</td>
    </tr>
     <tr>
        <td>Data2.1</td>
        <td>Data2.2</td>
        <td>Data2.3</td>
    </tr>
     <tr>
        <td>Data3.1</td>
        <td>Data3.2</td>
        <td>Data3.3</td>
    </tr>
</tbody>

#example, th, td {
    border: 1px solid black;
    border-collapse: collapse;
}
$("#example").resizable();
1

There are 1 answers

2
Rory McCrossan On BEST ANSWER

The resizable method is not part of the standard jQuery library - it's part of jQueryUI, so you need to include that too. Once you've done that your code will work:

Example fiddle