/    Sign up×
Community /Pin to ProfileBookmark

HTML Tables – Multiple rows back to one

Hi everybody,
I have a problem:
On my website, to make the display , I use a table, but a one point one of the cells splits in two, and then I want to to become one again , but I d’ont know how:

Ex:

[code=html]

<table>

<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>

<tr>
<td rowspan=”3″>4</td>
<td>5</td>
</tr>

<tr>
<td>6</td>
</tr>

<tr>
<td>7</td>
<td>8</td>
</tr>

</table>

[/code]

[url=http://www.servimg.com/image_preview.php?i=1&u=13770186] Output[/url]

I want the big space on top of n.8 and n.8 to become ONE cell, not three.

Can anybody help me?

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@GararionApr 11.2009 — The thing to remember about tables when workign with them is that the amount of columns you create in the first row of [B]that[/B] tabe is the amount of columns that wil be in each row in [B]that[/B] table. (reason for bolded 'that" is because this can be changed by create tables within tables).

So looking at your table, your have table that has 3 columns in each row, as defined by the first row. In your second row, you have create a cell that will span 3 rows. That leaves two other cells in each of those rows but you have only stated that there is one other cell, so the browser displays this as there being nothing in those cells not defined.

So to add the empty space you have to the cell numbered 8, you would want to do the same thing you did to cell 4. Ie)

[CODE]<table border="1">

<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>

<tr>
<td rowspan="3">4</td>
<td>5</td>
<td rowspan="3">6</td>
</tr>

<tr>
<td>7</td>
</tr>

<tr>
<td>8</td>
</tr>

</table>[/CODE]


I only added the border so you can more easily see where each cell is, can be removed.
×

Success!

Help @Fire_Cat spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...