/    Sign up×
Community /Pin to ProfileBookmark

span as a block element

[CODE]
<table cellpadding=”0″ cellspacing=”0″>
<tr><td>
<span class=”label”>label here</span>
</td></tr></table>
[/CODE]

CSS:

[CODE]
span.label {
display:block;
width: 100%;
border: 1px solid #000;
background: #fff;}
[/CODE]

With this kind of code, would the border and background extend to the sides of the table to create like it was a part of the table? Well, it was working with FF, but in IE, can’t seem to resolve it. The screenshot:

[upl-file uuid=b2b4f24a-94fc-4c6a-8ea0-17b55830672b size=474B]shot2fo2.gif[/upl-file]

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@ray326Jul 24.2007 — Why not use th instead of td and style the th instead of putting extra junk in there?
Copy linkTweet thisAlerts:
@webStruck_authorJul 25.2007 — I use (2) TDs to create two columns and another row has another set of TDs. Illustrated below is the sample structure:



<table>

<tr>

<td><span>Header1</span>

<p>bodyhere</p></td>

<td><span>Header2</span>

<p>bodyhere</p></td></tr>

<tr><td><span>Header3</span>

<p>bodyhere</p></td>

<td><span>Header4</span>

<p>bodyhere</p></td></tr>

[/QUOTE]


so for the Header3 and Header4 are another TDs... would the TH be possible here? I rarely use TH so I'm not really familiar on how to use it.
Copy linkTweet thisAlerts:
@felgallJul 25.2007 — <table>

<tbody>

<tr>

<th>Header1</th>

<td>bodyhere</td>

<th>Header2</th>

<td>bodyhere</td></tr>

<tr><th>Header3</th>

<td>bodyhere</td>

<th>Header4</th>

<td>bodyhere</td></tr>

</tbody>

</table>
Copy linkTweet thisAlerts:
@ray326Jul 26.2007 — Actually what I think you want is better mark up. Leaving the table be (shudder):
[code=html]
<table>
<tr>
<td><h3>Header1</h3>
<p>bodyhere</p></td>
<td><h3>Header2</h3>
<p>bodyhere</p></td></tr>
<tr><td><h3>Header3</h3>
<p>bodyhere</p></td>
<td><h3>Header4</h3>
<p>bodyhere</p></td></tr>
</table>
[/code]

Better yet with appropriately styled divs:
[code=html]
<div>
<h3>Header1</h3>
<p>bodyhere</p>
</div>
<div>
<h3>Header2</h3>
<p>bodyhere</p>
</div>
<div>
<h3>Header3</h3>
<p>bodyhere</p>
</div>
<div>
<h3>Header4</h3>
<p>bodyhere</p>
</div>
[/code]
Copy linkTweet thisAlerts:
@webStruck_authorJul 31.2007 — ok thanks!!!
×

Success!

Help @webStruck_ 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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