there are white spaces between elements when adding background color using IOL technique

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • Answered
I added a background color for the whole section by using IOL technique. It was working perfectly fine before I change something in the dev console yesterday. I am not sure what I did and I think I messed up somewhere. Now i redid the whole thing and there are white spaces between elements between the background color. Does anyone have any idea how to fix this problem?
 
BEFORE


NOW - There are white spaces between elements 


Please help with this problem. THANKS!!
Photo of Sales Info

Sales Info

  • 768 Points 500 badge 2x thumb

Posted 3 months ago

  • 0
  • 1
It looks to me like you may have changed the placement of the label. Moving it from above to the left. This is controlled by the form properties.

There may be other issues at play, but that one stands out to me as a difference between the two.

-Sharon
Photo of Sales Info

Sales Info

  • 768 Points 500 badge 2x thumb
Quick Base Junkie (find me on YouTube),

It works. Thanks so much for your help!!!
(Edited)
So glad my hunch worked out!
-Sharon
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,014 Points 20k badge 2x thumb
I don't know exactly what you did because you did not post any code but I can give you an understanding of why these white gaps appear. Using CSS QuickBase uses white borders on the <table> elements used to layout a section. This is a bit unusual and can be difficult to detect as most of the time table cell borders are black or some other visible color.

So you have to set the background-color on the table and the border-color for the cells:
$("table.formSection").css("background-color", "yellow");
$("table.formSection tr td").css("border-color", "yellow");
(Edited)
Photo of Sales Info

Sales Info

  • 768 Points 500 badge 2x thumb
Thanks for your code. However, if I set the background color on the table and the border color for the cell, the background color will be filled for the whole form which I don't want it to be. I only want to customize the background color for one tab, not the whole form. I am sticking with what is showing in the screenshot below. If you have any idea to make all the white spaces between elements to be filled in yellow, that would be great. Otherwise, I am sticking with this. Thanks!!


Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,014 Points 20k badge 2x thumb
>  if I set the background color on the table and the border color for the cell, the background color will be filled for the whole form which I don't want it to be

You just have to qualify which table section you want to modify by providing an appropriate selector:
$("<selector> table.formSection").css("background-color", "yellow");
$("<selector> table.formSection tr td").css("border-color", "yellow");

I don't know what <selector> should be as it would be specific to your form.
Photo of Sales Info

Sales Info

  • 768 Points 500 badge 2x thumb
Ⲇanom the ultimate (Dan Diebolt),

How do I figure out what <selector> for the section that I want to be customize is?

Thanks!



in this case, is <selector> tab_t30?
(Edited)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,014 Points 20k badge 2x thumb
After a quick look I would think you would identify the table with the #sect_s* id like this:
$("table#sect_s1 tr td").css("border-color", "yellow");
$("table#sect_s2 tr td").css("border-color", "yellow");
But for some reason you have an id without a value. Perhaps this is due to the fact you have tabs and QuickBase generates slightly different HTML in this case. 

In any event I don't have time to create an equivalent application to test this. If you need individual help you can contact me off-world using the information in my profile:

https://getsatisfaction.com/people/dandiebolt
Photo of Sales Info

Sales Info

  • 768 Points 500 badge 2x thumb
Ⲇanom the ultimate (Dan Diebolt),

I got it. It works. 

Yes. I am using tabs instead of using section.

$("#tab_t30 table.formSection").css("background-color", "yellow");
$("#tab_t30 table.formSection tr td").css("border-color", "yellow");

Thanks for your help!!