Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the colspan not working properly in this script? js bug or IE?

This question is related to this question I asked a little while back. The updated code is posted here. This to note is that i am looking to create a HTML table dynamically that looks similar to this:

<table>
  <tbody>
    <tr>
      <td colspan="3" align="right">Header</td>
    </tr>
    <tr>
      <td colspan="3" align="right">Header</td>
    </tr>
    <tr>
      <td colspan="3" align="right">Header</td>
    </tr>
    <tr>
      <td>Col1</td>
      <td>Col3</td>
      <td>Col4</td>
    </tr>
    <tr>
      <td>Col1</td>
      <td>Col3</td>
      <td>Col4</td>
    </tr>  

  </tbody>

</table>

I can get this done in markup but when I do it in js the colspan does not seem to work in IE7. Any hep will be greatly appreciated.

like image 860
Perpetualcoder Avatar asked Dec 21 '10 21:12

Perpetualcoder


People also ask

Why is my Colspan not working?

The colspan attribute just specifies how many columns (hence, how many slots in the grid for the table) a cell occupies. If you see the last cell of row 2 as the widest, then the reason is probably that it has most contents (or there is a width setting for it). Your demo code does not demonstrate such behavior.

How do I adjust Colspan in HTML?

Attribute Values: It contains a value i.e number Which specify the number of columns that a cell should span. Note: colspan=”0″ tells the browser to span the cell to the last column of the column group (colgroup).

What is the Colspan in HTML?

The colspan attribute defines the number of columns a table cell should span.


1 Answers

http://www.w3schools.com/jsref/prop_tabledata_colspan.asp

The colSpan javascript property has a capital S.

like image 71
Emmett Avatar answered Nov 02 '22 20:11

Emmett