How do I remove the white background from a table? Foundation Rails

0

Well, my problem is that I added foundation rails to my project that is created in ruby on rails and I wanted to create a small table, but when creating this table it gives me a white background, what I want to do is that my table be transparent without any color background.

already try putting a class and assigning properties but it does not work, also add the style directly, delete cookies just in case but still does not change color, just change size.

.css file

.tabla {
    width:80%;
    height: 80%;
    background-color:transparent;
}

.html.erb file

<table border="2"  class="tabla">
  <tr>
    <td>Film Affinity</td>
    <td><%= image_tag "film_affinity.png",:class=>"imagenPie"%></td>
  </tr>
    <tr>
    <td>IMDB</td>
    <td><%= image_tag "imdb.png",:class=>"imagenPie"%></td>
  </tr>
    <tr>
    <td>Sensa Cine</td>
    <td><%= image_tag "sensacine.png",:class=>"imagenPie"%></td>
  </tr>

</table>
    
asked by David 20.12.2016 в 17:09
source

1 answer

0

You also need to modify the css of the elements within the table.

#rojo{
  background-color: #ff0000;
}

.tabla {
    width:80%;
    height: 80%;
    background-color:transparent;
}
.tabla tbody {
    background-color:transparent;
}
.tabla tbody tr:nth-child(even) {
    background-color:transparent;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.0/css/foundation.min.css" rel="stylesheet" />
<div id='rojo'>
  <table border="2" class="tabla">
    <tr>
      <td>Film Affinity</td>
      <td>
        <%= image_tag "film_affinity.png",:class=>"imagenPie"%>
      </td>
    </tr>
    <tr>
      <td>IMDB</td>
      <td>
        <%= image_tag "imdb.png",:class=>"imagenPie"%>
      </td>
    </tr>
    <tr>
      <td>Sensa Cine</td>
      <td>
        <%= image_tag "sensacine.png",:class=>"imagenPie"%>
      </td>
    </tr>
  </table>
</div>

In the future, you can check on your own what styles apply to each item in chrome by right clicking and choosing "Inspect". There you will find a section where on the left you can see the elements of your html and on the right the css styles that apply to the element you choose.

    
answered by 21.12.2016 в 15:47