Print table footer at the very bottom on last page

后端 未结 3 1244
天命终不由人
天命终不由人 2021-01-01 13:18

I am using a table to create a footer on every page (works in Firefox, that\'s enough).

A JS Fiddle: https://jsfiddle.net/j9k2xzze/

(right click on the outpu

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 13:33

    There is no way to have footer only on last page if you use absolute or fixed position. If you want footer on the bottom only if page in not long enough, use sticky footer technique thats doesn't require absolute/fixed position. Something like this

    html, body {
      height: 100%;
      margin: 0;
    }
    .wrapper {
      min-height: 100%;
      margin-bottom: -50px;
    }
    .footer,
    .push {
      height: 50px;
    }
    

    If you really need footer at the bottom of each page I would recommend to generate pdf first and print it. If you need to print complex stuff you will end up generating pdfs first anyway, print css is very limited.

提交回复
热议问题