Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Colspan not working on bootstrap table

I have a nested bootstrap table and I want colspan to work on it, but it does not seem to work.

At the end of the day, I would like to end up with something like this:

   ____________________
  |   Col1 | Col2      |
  |--------------------|
  |This is data I want |
  |--------------------|
  | Col 1  | Col 2     |
  ---------------------- 

I created this fiddle to demonstrate the full functionality.

like image 910
Jacques Bronkhorst Avatar asked Feb 12 '13 11:02

Jacques Bronkhorst


2 Answers

I have fixed your fiddle

 <tr class="child">
     <td colspan="7">
      <table>
         <tr>
            <td colspan="7">Expand This To Full Table</td>
          </tr>
      </table>
     </td>
</tr>
like image 119
Gericke Avatar answered Oct 21 '22 05:10

Gericke


As G-Man mentioned, you need to have the outermost td to do the colspan. The inner table actually does not need any colspan as follows. Although, I don't think it would be a good idea to nest table within a table, but it's really up to you depending on the situation. Fiddle Updated

<td colspan="7">Some Content Here</td>
like image 29
Angela Avatar answered Oct 21 '22 06:10

Angela