Jump to content

Table Header Won't Span Columns


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.

Edited by jkloth
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...