I've created a jQuery plugin which takes a HTML table, makes it sortable, and fixes the header and footer. See http://jsfiddle.net/aXDzz/ for an example (click create to create the table).
Works good, but then recently needed to add some padding or margin around the table. This caused some problems.
My plugin basically replaces the original <table>
with a <div>
which contains a <table>
for the header, a <div>
which intern contains a <table>
for the body, and a <table>
for the footer. My intent was for the user to apply CSS to the original table, and upon using my plugin, the CSS would appropriately transfer. As stated above, however, I wrap a <div>
around the table so that now the margin or padding should be applied to the <div>
and not the <table>
.
So, looks like I need to move any CSS which applies to the exterior of the <table>
to the <div>
such as margin, but then leave any CSS which applies to the interior of the <table>
such as the row color alone.
How would I do this? Or is there a better way altogether I should be implementing this? Thanks
PS. Please feel free to critique my plugin as it is my first attempt.