Colgroup border in IE?

I have a weird one - to me, anyway. I was trying to apply a border to colgroup - works fine in non-IE browsers, but it wasn’t working in IE on my machine. When I uploaded a sample so I could post it here the live copy works fine - even in IE! What gives? From what I’ve read, it should work in IE except maybe IE6. What could be going on that causes it to fail locally? Do I need to worry about it?

Here’s the link to a test page - the code is below. I extracted out the styles I thought you might want to see and put them in style tags but the main style sheet is also linked:


<!DOCTYPE html>
<html style="background-color:#fff;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="_styles/default.css" />
<style>

	.tableContent table {
		margin:0 0 1em 0;
		width:auto;	
		border-collapse:collapse;
		}
		
	.tableContent table td {
		border:1px solid #ccc;
		}

	table#testTable  {
		border:1px solid #ccc;
		}

	table#testTable tbody tr td  {
		border:0;
		padding:5px;
		}
	
	table#testTable colgroup {
		border:1px solid #ccc;
		}

</style>
</head>

<body style="background-color:#fff; padding:30px;">

<div class="tableContent">
<table id="testTable">
		<colgroup span="3"></colgroup>
		<colgroup span="5"></colgroup>			
		<colgroup span="4" id="goldBg"></colgroup>		
		<colgroup span="4" id="greenBg"></colgroup>		
		<colgroup span="2" id="beigeBg"></colgroup>
		<colgroup></colgroup>
		<thead>
			<tr>
				<td rowspan="2" colspan="3" class="mainHeader">Tools</td>
				<td rowspan="2" colspan="5" class="mainHeader">Sessions</td>
				<td colspan="8" class="mainHeader" id="bilPayAdj">Bills, Payments & Adjustments</td>
				<td colspan="2" rowspan="2" class="mainHeader bottomBorderNone" >Balances<div id="total">Client: $270.00<br />Account: $sss.xx</div></td>
				<td rowspan="2" class="mainHeader">Notes</td>
			</tr>
			
			<tr>
				<td colspan="4" class="subHeader" id="bills">Bills Sent</td>
				<td colspan="4" class="subHeader" id="payments">Payments Received</td>
			</tr>
			
			<tr>
				<th>&nbsp;</th>
				<th>Show</th>
				<th>Finish</th>
				<th>Date</th>
				<th>Type</th>
				<th>Therapist</th>
				<th>Fee</th>
				<th>Adj<br />Fee</th>
				<th>Date<br />Submitted</th>
				<th>Sent<br />To</th>
				<th>Amount</th>
				<th>Type</th>
				<th>Date<br />Received</th>
				<th>Payer</th>
				<th>Pmt<br />Amt</th>
				<th>Adj<br />Amt</th>
				<th>Session<br />Balance</th>
				<th>Account<br />Total</th>
				<th>&nbsp;</th>
			</tr>		
		</thead>
		
		<tbody>
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
				<td>5</td>
				<td>6</td>
				<td>7</td>
				<td>8</td>
				<td>9</td>
				<td>10</td>
				<td>11</td>
				<td>12</td>
				<td>13</td>
				<td>14</td>
				<td>15</td>
				<td>16</td>
				<td>17</td>
				<td>18</td>
				<td>19</td>
			</tr>
			
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
				<td>5</td>
				<td>6</td>
				<td>7</td>
				<td>8</td>
				<td>9</td>
				<td>10</td>
				<td>11</td>
				<td>12</td>
				<td>13</td>
				<td>14</td>
				<td>15</td>
				<td>16</td>
				<td>17</td>
				<td>18</td>
				<td>19</td>
			</tr>
			
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
				<td>5</td>
				<td>6</td>
				<td>7</td>
				<td>8</td>
				<td>9</td>
				<td>10</td>
				<td>11</td>
				<td>12</td>
				<td>13</td>
				<td>14</td>
				<td>15</td>
				<td>16</td>
				<td>17</td>
				<td>18</td>
				<td>19</td>
			</tr>
		</tbody>
		
		<tbody>
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
				<td>5</td>
				<td>6</td>
				<td>7</td>
				<td>8</td>
				<td>9</td>
				<td>10</td>
				<td>11</td>
				<td>12</td>
				<td>13</td>
				<td>14</td>
				<td>15</td>
				<td>16</td>
				<td>17</td>
				<td>18</td>
				<td>19</td>
			</tr>
			
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
				<td>5</td>
				<td>6</td>
				<td>7</td>
				<td>8</td>
				<td>9</td>
				<td>10</td>
				<td>11</td>
				<td>12</td>
				<td>13</td>
				<td>14</td>
				<td>15</td>
				<td>16</td>
				<td>17</td>
				<td>18</td>
				<td>19</td>
			</tr>
			
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
				<td>5</td>
				<td>6</td>
				<td>7</td>
				<td>8</td>
				<td>9</td>
				<td>10</td>
				<td>11</td>
				<td>12</td>
				<td>13</td>
				<td>14</td>
				<td>15</td>
				<td>16</td>
				<td>17</td>
				<td>18</td>
				<td>19</td>
			</tr>
		</tbody>

</table>
</div>
</body>
</html>


Hi,

IE6 and 7 don’t support borders on colgroup or col elements. IE8 is fine though.

Your demo seems to confirm this in my browsers online and offline.

The colgroup and col elements have limited styling capabilities anyway and the specs say that only the following are allowed:

  • border
  • background
  • width
  • visibility

IE6/7 doesn’t support border but it does support color when it shouldn’t :slight_smile:

Yikes. I was OK with thinking I’d lose the borders on IE6 but I didn’t know about 7. So the only other solution for what I’m wanting is to use a class for the tds that need a border or else to count them up and put borders on the correct td (td+td+td+td, etc.)?

Yes I’m afraid so. It’s a bit of a pain I know :slight_smile: