Skip to content

Develop CSS for new as_html support for headers/footers/referential footnotes #247

@gmbecker

Description

@gmbecker

working baseline proof of concept as of 0.3.8.9012 in gabe_tabletree_work

headers go in divs inside caption tag, footers go in div after table:

    analysisfun <- function(x, ...) {
        in_rows(row1 = 5,
                row2 = c(1, 2),
                .row_footnotes = list(row1 = "row 1 rfn"),
                .cell_footnotes = list(row2 = "row 2 cfn"))
    }

    lyt <- basic_table(title = "Title says Whaaaat", subtitles = "Oh, ok.",
                   main_footer = "ha HA! Footer!") %>%
    split_cols_by("ARM") %>%
    analyze("AGE", afun = analysisfun)

    result <-  build_table(lyt, ex_adsl)
> as_html(result, link_label="mylinklabel1")
<div class="rtables-all-parts-block rtables-container">
  <table class="table table-condensed table-hover">
    <tr class="">
      <th class="" style="white-space:pre;"></th>
      <th class=" text-center" colspan="1">A: Drug X</th>
      <th class=" text-center" colspan="1">B: Placebo</th>
      <th class=" text-center" colspan="1">C: Combination</th>
    </tr>
    <tr class="">
      <td class=" text-left" colspan="1">row1 {1}</td>
      <td class=" text-center" colspan="1">5</td>
      <td class=" text-center" colspan="1">5</td>
      <td class=" text-center" colspan="1">5</td>
    </tr>
    <tr class="">
      <td class=" text-left" colspan="1">row2</td>
      <td class=" text-center" colspan="1">1, 2 {2}</td>
      <td class=" text-center" colspan="1">1, 2 {3}</td>
      <td class=" text-center" colspan="1">1, 2 {4}</td>
    </tr>
    <caption style="caption-side:top;">(\#tag:mylinklabel1)
      <div class="rtables-titles-block rtables-container">
        <div class="rtables-main-titles-block rtables-container">
          <p class="rtables-main-title">Title says Whaaaat</p>
        </div>
        <div class="rtables-subtitles-block rtables-container">
          <p class="rtables-subtitle">Oh, ok.</p>
        </div>
      </div>
    </caption>
  </table>
  <div class="rtables-footers-block rtables-container">
    <div class="rtables-ref-footnotes-block rtables-container">
      <p class="rtables-referential-footnote">{1} - row 1 rfn</p>
      <p class="rtables-referential-footnote">{2} - row 2 cfn</p>
      <p class="rtables-referential-footnote">{3} - row 2 cfn</p>
      <p class="rtables-referential-footnote">{4} - row 2 cfn</p>
    </div>
    <div class="rtables-main-footers-block rtables-container">
      <p class="rtables-main-footer">ha HA! Footer!</p>
    </div>
  </div>
</div>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions