tags:

views:

1993

answers:

2
+2  A: 

it does, but you've limited the width. If you want, try creating another class called '.doubleSpanInputGroup' or something with width 500 and set that class onto the spanning column.

eg.

<html>
  <head>
    <style>
    .inputGroup td
    { width:250px; }   
    .inputGroup td.doubleInputGroup
    { width:500px; } 
    </style>
  </head>
<body>
<table class="inputGroup">
  <tr>
    <td>cell1</td>
    <td>cell2</td>
  </tr>
  <tr>
    <td colspan="2" class="doubleInputGroup">This should span two columns but it doesnt</td>
  </tr>
  <tr>
    <td>cell1</td>
    <td>cell2</td>
  </tr>
</table>
</body>
</html>

EDIT: made the new style more hierarchical

Luke Schafer
Oh wow. Thanks, sometimes you just don't see what's right in front of you.
Alex
yeah no probs, easy mistake. Please make sure you use my revised version above as the first pass had a small problem :) woops.
Luke Schafer
+1  A: 

Try making the rule apply to tr instead of td and make the width 500px instead, as such:

.inputGroup tr { width: 500px; }

The problem you're having is because you've set a limit on the td to be at most 250px wide, so the browser is simply following your instructions.

Deniz Dogan