/    Sign up×
Community /Pin to ProfileBookmark

Replace TABLE to DIV

Hi,
Spoonfeed me please, you see my site uses a lot of tables(they say its bad use instead the div thing) and so it gives me the crap for their are tons of them on every pages, its quite a basic problem(I’m actually in a hurry so I let you guys do the hardship ? ) .

I got this code:
[CODE] <table>
<tr>
<td>hello </td>
<td>hello </td>
<td>hello </td>
</tr>
<tr>
<td colspan=”3″>hello </td>
</tr>
</table>[/CODE]

but this is not the equivalent ?

[CODE]<div>
<ul>
<li>hello </li>
<li>hello </li>
<li>hello </li>
</ul>
<ul>
<li colspan=”3″>hello </li>
</ul>
</div>[/CODE]

hope you could help, thanks!

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 05.2006 — You need to add CSS to your HTML, for example:
[code=html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
<title>Page Title</title>
<style type="text/css">
#test ul {
list-style: none;
margin: 0;
padding: 0;
clear: both;
}
#test li {
float: left;
margin: 2px;
padding: 5px 10px;
width: 100px;
text-align: center;
border: solid 1px red;
}
</style>
</head>
<body>
<div id="test">
<ul>
<li>hello</li>
<li>hello</li>
<li>hello</li>
</ul>
<ul>
<li style="width: 352px">hello</li>
</ul>
</div>
</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@KDLAJun 05.2006 — (colspan, what you've used in your table-to-css example, is only applicable to tables. colspan is short for column-span.)
Copy linkTweet thisAlerts:
@imperialauthorJun 09.2006 — Thank you so much guys!,NogDog & KDLA, I know now what to do!
×

Success!

Help @imperial 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,
)...