/    Sign up×
Community /Pin to ProfileBookmark

Useless colspan

What DTD will actually let the colspan work properly?

Im using XHTML1.0 Trans and when I have two cells below a cell with colspan=2, I cant set the width of either of the bottom cells? Whats up?

Is this by design? Any ideas?

Thanks.

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@FangApr 17.2004 — Like this?
<i>
</i>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
&lt;head&gt;
&lt;title&gt;width in td&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table border="1" cellpadding="0" cellspacing="0" summary=""&gt;
&lt;tr&gt;&lt;td colspan="2"&gt;a&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width="200px"&gt;b&lt;/td&gt;&lt;td width="100px"&gt;c&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@PhilgBauthorApr 17.2004 — Almost, sorry I should have given an example.

The table width is 100% and the lower right cell should be automatic. The lower left cell being 15px.

<i>
</i>&lt;table width="100%"&gt;
&lt;tr&gt;&lt;td colspan="2"&gt;blah&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width="15"&gt;img&lt;/td&gt;&lt;td [width="100%"]&gt;rightcell&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;


When I put width="100%" in rightcell it squishes the img cell regardless of width.
Copy linkTweet thisAlerts:
@FangApr 18.2004 — This is the way it works; the 100% over rides the value in the left cell.

There is no need to have 100% in the right cell, it will stretch automatically to take up the rest of the width of the table.

This is all that is needed:
<i>
</i>&lt;table width="100%"&gt;
&lt;tr&gt;&lt;td colspan="2"&gt;blah&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td width="15"&gt;img&lt;/td&gt;&lt;td&gt;rightcell&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
Copy linkTweet thisAlerts:
@PhilgBauthorApr 18.2004 — No, thats why I put the brackets around [width=100%] because when its not there, the leftcell is too big and doesnt stay at width=15 and when it is there, its squishes down to whatever is in its cell.

I dont mind the second part, it makes sense. But having a table with width 100% and the left cell having width 15, it should work.
Copy linkTweet thisAlerts:
@FangApr 18.2004 — 15px is very narrow so any text will be squashed, images will retain their true width.

Can you give a full example/page?

The problem maybe in another container or css.
×

Success!

Help @PhilgB 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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