1

Is it possible remove white space (padding) inside cell?

Query return cell background color like this:

Select
'<span style="background-color: #B8817D">' || col_1 || '</span>' as "1",
'<span style="background-color: #B8817D">' || col_2 || '</span>' as "2",
'<span style="background-color: #F7DC6F">' || col_3 || '</span>' as "3",
'<span style="background-color: #F7DC6F">' || col_4 || '</span>' as "4"
.....

enter image description here

user_odoo
  • 2,284
  • 34
  • 55

2 Answers2

4

It requires a bit of hacking, but it should work.

First add this page level inline CSS:

.no-parent-padding {
    padding: 8px;
    margin: -12px -12px;
}

.yellow-background {
    background-clip: content-box;
    box-shadow: inset 0 0 0 12px yellow;
    background-color: yellow;
}

.brown-background {
    background-clip: content-box;
    box-shadow: inset 0 0 0 12px brown;
    background-color: brown;
}

Next the SELECT should look as follow:

select      
    '<div class="brown-background no-parent-padding">'|| 12 ||'</div>' AS "12",
    '<div class="yellow-background no-parent-padding">'|| 2 ||'</div>' AS "2"
....

Finally the result: enter image description here

davidm
  • 1,570
  • 11
  • 24
0

I'd like to reference to this clean solution from Kutub Tech: youtubecode to be found here

Steps:

  1. Select desired Column > go to "Advanced" > set "Static ID" > set rep_col_diffcolor_1
  2. (optional) Select another Column > go to "Advanced" > set "Static ID" > set rep_col_diffcolor_2
  3. Select Page Root > go to "Inline" > paste the following
.a-IRR-table tr td[headers*="rep_col_diffcolor_1"] {
    background-color: #99ccff;
}
    
.a-IRR-table tr td[headers*="rep_col_diffcolor_2"] {
    background-color: #bfc4c9;
}
Joe Web
  • 558
  • 5
  • 11