Siva Bathula
Siva Bathula

Reputation: 766

Is it possible to make tfoot appear above tbody within the same table?

I am working around a limitation of using a jquery plugin and rendering my table according to the standards, i.e. thead, tfoot and tbody in that order. The browser then correctly renders it, and makes the tfoot appear below the tbody as is supposed to do. Is there a hack/straight forward way to make the tfoot appear and render above the tbody as well?

Upvotes: 7

Views: 6297

Answers (2)

Brandon
Brandon

Reputation: 39212

You can mess around with absolute positioning of the tfoot and tbody elements. I'm not sure how it works cross-browser and you need to know the positions. But here's an example:

table {
    position: relative;
}
tfoot {
    position: absolute;
    top: 25px;
}

tbody {
    position: absolute;
    top: 50px;
}

http://jsfiddle.net/YJhk2/

Upvotes: 2

Explosion Pills
Explosion Pills

Reputation: 191779

Something sounds wrong to me, but you can change the display type of the tfoot

tfoot {
    display: table-row-group;
}

http://jsfiddle.net/ExplosionPIlls/UMZr4/

Upvotes: 19

Related Questions