I want to know how to create a table where you can adjust the column widths. I have not figured out how to do this. If you know the secret sauce to this technique please let me know.
Add this CSS to make your table's column widths adjustable...
th {resize:horizontal; overflow:auto;}
There is no simple answer such as "use some foobar html property".
This is done with javascript and DOM manipulations.
If you are curious to see an implementation of this feature with Prototype you can take a look at TableKit.
I am sure there are jQuery implementations out there... I like my good old Prototype ;)
I believe it's as simple as capturing a mouse click event at an area at the edge of a cell header, and then dynamically changing the width of the column as the mouse is dragged.
Are you looking for the effect of outlook or there is the <-> that show up to show you to resize the table?
Flexigrid for jQuery seems pretty sweet.
Update: As per @Vincent's comment the use is really simple... see the site for full details, however for the most basic example - include the script then hook the functionality to your table:
$('#myTableID').flexigrid();
or with options:
$('.classOfTables').flexigrid({height:'auto',striped:false});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With