Beginner
Beginner

Reputation: 29543

colspan rowspan issue?

Im trying to create a table which has 6 columns and 6 rows. the first td should be spread across four columns and four rows. then the second td of the first row should be 2 col span. the bottom two rows are just 6 tds.

this is the code im trying... http://jsfiddle.net/uzi002/dByer/1/

but its messing up...this is what im trying to get...

enter image description here

Upvotes: 0

Views: 1366

Answers (2)

Ryan
Ryan

Reputation: 28187

Here is an example of what you want, with 'placeholder' cells added to achieve the desired layout: http://jsfiddle.net/NGP3x/

You are stretching rowspans over rows that aren't there though... you might just want to use CSS to get the visual result you have in mind.

enter image description here

Upvotes: 1

janzi
janzi

Reputation: 503

You are trying to use rowspan over rows that does not exist. And you bottom rows did not have enough columns.

Try this:

<table id="phototable" border=1>
<tr>
  <td rowspan="2" colspan="4">1</td> 
  <td colspan="2">2</td>
</tr>
<tr>
  <td colspan="2">3</td>
</tr>
<tr>
  <td>6</td>
  <td>6</td>
  <td>6</td> 
  <td>6</td>
  <td>6</td>
  <td>6</td>
</tr>
<tr>
  <td>6</td>
  <td>6</td>
  <td>6</td>
  <td>6</td> 
  <td>6</td>
  <td>6</td>
</tr>

Upvotes: 1

Related Questions