HTML генерирует заголовок слова динамически на каждой странице - PullRequest
0 голосов
/ 14 мая 2019

Я создаю «Документ Word для студента» с динамическим заголовком на каждой странице.Содержимое заголовка: номер страницы, дата, имя, номер студента.Информация о каждом ученике разделена на «стиль разрыва страницы».

CSS «mso-header» необходимо связать с указанным содержимым заголовка идентификатора, поэтому я не могу связать заголовок динамически.Например, свяжите заголовок mso с идентификатором «h1», а не с h1, h2, h3 ... (динамический)

  <style>     
         <!-- /* Style Definitions */ 
         p.MsoHeader, li.MsoHeader, div.MsoHeader{ 
         margin:0in; 
         margin-top:.0001pt; 
         mso-pagination:widow-orphan; 
         tab-stops:center 3.0in right 6.0in; 
         } 
         @page Section1{ 
          size:8.5in 11.0in; 
          margin:1.0in 1.0in 1.0in 1.0in;
          mso-header-margin:1.1in;
          mso-title-page:yes; 
          mso-header:h1; 
          mso-footer-margin:0.5in; 
          mso-paper-source:0;    
         } 
         div.Section1{ 
          page:Section1; 
         } 

  </style> 

и содержимым:

lc_pg_break CONSTANT VARCHAR2(1000) := '<br clear=all style="mso-special-character:line-break;page-break-before:always">';

    <div class="Section1">
    loop  /*loop different student info*/
      if count>1 then
      htp.p(lc_pg_break);/*when display second student, add page break style */
      end if;
      <div style="mso-element:header" id="h1" > 
         <p class="MsoHeader" >
         ...student info

         </p>
       </div>
    end loop
    </div>
...