Page 1 of 1

using css with html tables

Posted: Wed Dec 18, 2002 11:02 am
by rathlon
How do you use the colspan property or what is the likewise property in css?

Posted: Wed Dec 18, 2002 12:42 pm
by Takuma
You can't. colspan is nothing to do with decorating the page which is what basically CSS does.

Posted: Thu Dec 19, 2002 5:17 am
by f1nutter
colspan lets you merge the cells of a table

Code: Select all

|-------|-------|-------|-------|
| cell1 | cell2 | cell3 | cell4 |
|-------|-------|-------|-------|
| cell5 |  merged cell  | cell6 |
|-------|-------|-------|-------|
| cell7 | cell8 | cell9 | cell0 |
|-------|-------|-------|-------|

Code: Select all

<table>
 <tr>
  <td>cell1</td>
  <td>cell2</td>
  <td>cell3</td>
  <td>cell4</td>
 </tr>
 <tr>
  <td>cell5</td>
  <td colspan=2>merged cell</td>
  <td>cell6</td>
 </tr>
 <tr>
  <td>cell7</td>
  <td>cell8</td>
  <td>cell9</td>
  <td>cell0</td>
 </tr>
</table>
You can do the same with rowspan, merging cells vertically.