Edit the 'style' of the external 'div' tag of a box in Shiny

7

I'm developing an app in Shiny of R, and I'm having trouble editing the tag outside of a box.

When I run the command:

box(
  title = 'Teste',
  width = 4
)

The corresponding HTML it creates is:

<div class="col-sm-4">
  <div class="box">
    <div class="box-header">
      <h3 class="box-title">Teste</h3>
    </div>
    <div class="box-body"></div>
  </div>
</div>

There is the style parameter in box() , however it only changes the "box-body" class and I wanted to change the "col-sm-4" class without having to input the HTML in my code,

For example, if I run:

box(
  title = 'Teste',
  width = 4,
  style = 'padding-left: 0px;'
)

It generates:

<div class="col-sm-4">
  <div class="box">
    <div class="box-header">
      <h3 class="box-title">Teste</h3>
    </div>
    <div class="box-body" style="padding-left: 0px;"></div>
  </div>
</div>

But I want to:

<div class="col-sm-4" style="padding-left: 0px">
  <div class="box">
    <div class="box-header">
      <h3 class="box-title">Teste</h3>
    </div>
    <div class="box-body"></div>
  </div>
</div>
    
asked by anonymous 23.01.2017 / 22:04

2 answers

2

I was able to find a solution.

When I create the box with width = NULL it does not come inside a div, so I can create the div myself (in R is column() ), however it gets an extra div.

For example:

box(
  title = 'Teste',
  width = NULL
)

becomes

<div>
  <div class="box">
    <div class="box-header">
      <h3 class="box-title">A</h3>
    </div>
    <div class="box-body"></div>
  </div>
</div>

So if I do:

column(
  width = 4, style='padding-left: 0px;',
  box(
    title = 'A',
    width = NULL
  )
)

I have

<div class="col-sm-4" style="padding-left: 0px;">
  <div>
    <div class="box">
      <div class="box-header">
        <h3 class="box-title">A</h3>
      </div>
      <div class="box-body"></div>
    </div>
  </div>
</div>
    
24.01.2017 / 01:00
0

I do not know what Shiny looks like in css would be

.box {

  width : 4px;
  padding-left: 0px;
}

I do not know if it helps.

    
23.01.2017 / 22:14