Tahsin Yurtseven
Tahsin Yurtseven

Reputation: 63

Printing Table Header with two theads on all pages

I want to print a table with double headlines on every page. On the first page it works well, but on the following pages it prints only the first headline.

css

@media print {
    thead {
       display: table-header-group;
    }
}

Html for my table.

<tr>
   <thead>
      <th colspan="2">A</th>
      <th>B</th>
      <th>C</th>
   <thead>
      <th>1</th>
      <th colspan="2">2</th>
      <th>3</th>
</tr>

Thanks for help.

I try to add a class to the second thead and then group it in css instead of thead -> .className but it don't work. I had the same result.

Upvotes: 0

Views: 271

Answers (1)

Anshad Vattapoyil
Anshad Vattapoyil

Reputation: 23483

Try this,

<thead>
   <tr>
      <th colspan="2">A</th>
      <th>B</th>
      <th>C</th>
   </tr>
   <tr>
         <th>1</th>
         <th colspan="2">2</th>
         <th>3</th>
   </tr>
</thead>

Upvotes: 1

Related Questions