Professional Documents
Culture Documents
2015 - s2 - WD - Week 8 - Coding Day 12 Merging Cells
2015 - s2 - WD - Week 8 - Coding Day 12 Merging Cells
2015 - s2 - WD - Week 8 - Coding Day 12 Merging Cells
Column 2
Row 3
Column 2
Column 3
Row 3
Column 3
CODE?
Row 1
Column 1
Row 1
Column 2
Row 1
Column 3
Row 2
Column 1
Row 2
Column 2
Row 2
Column 3
Row 3
Row 3
Row 3
Column 3
Column 1
Column 2
<table cellspacing="0" cellpadding="4"
border="1">
<tr>
</tr>
<tr>
<td>Row 2 Column 1</td><td>Row 2 Column 2</td><td>Row 3 Column
3</td>
</tr>
<tr>
<td>Row 3 Column 1</td><td>Row 3 Column 2</td><td>Row 3 Column
3</td>
</tr>
</table>
MERGING CELLS
Needs a COLSPAN ATTRIBUTE
SYNTAX: colspan=x
Replace x with number of
columns to span
Example below x=2
Heres how:
<tr>
<td colspan="2">Row 2 Column
1</td><td>Row 2 Column 2</td>
</tr>
TRY
IT!
colspan=3
In ROW 2 and delete the
others
Dont forget an
align=center
tag!
MERGING CELLS
Needs a ROWSPAN ATTRIBUTE
SYNTAX: rowspan=x
Replace x with number of rows
w
o
to span
st R
1
n
i
!
Y
e
L
Example below x=3
d
o
ON
C
</tr>
<tr>
<td>Row 2 Column 1</td><td>Row 2 Column
2</td>
</tr>
<tr>
<td>Row 3 Column 1</td><td>Row 3 Column
2</td>
</tr>
</table>
ACTIVITY
1. Open
ACTIVITY
1. Open