• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Header style in tables - Robohelp 2020 Update 6

Explorer ,
Apr 06, 2022 Apr 06, 2022

Copy link to clipboard

Copied

Hi,

I need to create a table where the first row is the table header and it has a different style; for example, it has a background color, and the text is bold and centralized.

Also, in the PDF output, I want the table header to repeat if the table breaks between pages. 

 

I define a style for the <th> tag and then applied the Convert to Header option on the first row. The style of the <th> tag got applied to the selected row but the table header did not repeat when the table overflowed to the next page. 

 

Can anybody please help with this issue?

 

 

Views

251

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 06, 2022 Apr 06, 2022

Copy link to clipboard

Copied

Never really played with table formatting, but I would suggest updating to Patch 7 first.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 06, 2022 Apr 06, 2022

Copy link to clipboard

Copied

I don't think that is supported in PDF or Word outputs. Word has that option to set within Word.

________________________________________________________
My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

 

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 06, 2022 Apr 06, 2022

Copy link to clipboard

Copied

LATEST

If you modify the code in your topic and stylesheet you should be able to get it to work. 

 

As always, use a test project/topic in case something goes wrong. 🙂

 

You've converted the first row to a heading so your code should look something like this:

 <table border="1" cellpadding="1" cellspacing="1" class="Shaded" style="border-collapse:collapse; width:100%">
    <colgroup>
      <col style="width:16.67%" />
      <col style="width:16.67%" />
      <col style="width:16.67%" />
    </colgroup>
     <tbody>
      <tr>
        <th>Heading</th>
        <th>Heading</th>
        <th>Heading</th>
      </tr>
      <tr>
        <td>test</td>
        <td>test</td>
        <td>test</td>
      </tr>

You need to move the <tbody> tag underneath your first row, and add <thead></thead> around your first row. I've added some notes to highlight the changes, but don't include these notes in your page.

<table border="1" cellpadding="1" cellspacing="1" class="Shaded" style="border-collapse:collapse; width:100%">
    <colgroup>
      <col style="width:16.67%" />
      <col style="width:16.67%" />
      <col style="width:16.67%" />
    </colgroup>
     <thead> /*added thead here*/
      <tr>
        <th>Heading</th>
        <th>Heading</th>
        <th>Heading</th>
      </tr>
    </thead> /*added /thead here*/
    <tbody> /*moved tbody here*/
      <tr>
        <td>test</td>
        <td>test</td>
        <td>test</td>
      </tr>

If your header styling is now messed up you need to go into the stylesheet code to change the style for your header. It'll look something like this:

 

table.MyTableStyle tr:first-child td {
  color: white;
  background-color: green;
  font-weight: bold
}

Change table.MyTableStyle tr:first-child td to table.MyTableStyle thead th.

table.MyTableStyle thead th {
  color: white;
  background-color: green;
  font-weight: bold
}

 

See if that works for you.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp