Jump to content

Table Header Won't Span Columns


ShadowMage

Recommended Posts

I've got a table that I'm inserting a group of rows and cells into. The problem is the table header cell won't span the columns. It's only as long as the text that's in it, but I need it to span the entire table.Here is what I've tried:

newRow = objTable.insertRow(lastIndex);newCell = newRow.insertCell(0);element = document.createElement("th");element.className = "gridHdr header14pt";//Tried it this way, but to no availelement.colSpan = 7;//Tried this way, too//element.style.width = "100%";element.innerHTML = type+" Type "+index;newCell.appendChild(element);

I've also tried this. This spans the cells but the formatting isn't there:

newRow = objTable.insertRow(lastIndex);newCell = newRow.insertCell(0);newCell.colSpan = 7;newCell.className = "gridHdr header14pt";newCell.innerHTML = type+" Type "+index;

Any advice/help is appreciated, thank you.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...