bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

A contained default table is incorrectly styled.

Open dogweather opened this issue 14 years ago • 4 comments

A default table (w/out a class) inside of a table which is assigned class="table" is styled as if the contained table also had this class applied. I.e., instead of no styling whatsoever, it shows the TB styling.

This is a problem for our particular app where we want to display tabular data within a table row, and we don't want a second set of row lines, etc., displayed.

Code to reproduce the error:

<table class="table">
  <tr>
    <td>

      <table>
        <tr>
          <td>1</td>
          <td>2</td>
        </tr>
        <tr>
          <td>2</td>
          <td>1</td>
        </tr>
      </table>

    </td>
  </tr>
</table>

I'm currently looking for a work-around — a way to display the inner table completely unstyled.

dogweather avatar May 02 '12 02:05 dogweather

Could you make a new table class to negate the effects from the parent table?

AegirisSystems avatar May 02 '12 02:05 AegirisSystems

Maybe. I actually realized, that since the borders were the only real problem for us, I just removed them with a style attribute on the contained td's.

dogweather avatar May 02 '12 02:05 dogweather

Yeah, not something we will typically have to solve for the entire framework. Stick to modifying that on your own for now.

mdo avatar May 02 '12 16:05 mdo

This problem is still causing issues for me. I am trying to remove hover on both the outer and the inner tables using :

.table tbody tr:hover td, .table tbody tr:hover th { background-color: transparent; }

.table-striped tbody tr:nth-child(odd):hover td, .table-striped tbody tr:nth-child(odd):hover th { background-color: #F9F9F9; }

However, when I hover over the cell that contains the inner table, the background color of the inner table changes.

Manually enforcing a background color such as the following does not work: .inner_table { background-color: blue; }

chanh avatar Jul 12 '12 19:07 chanh