/    Sign up×
Community /Pin to ProfileBookmark

My CSS for Tables; Not showing up right.

On my web page I have some data that I present in several tables.

I want to use CSS to control the data style, but I can’t figure it out.

This is what I started off with:

[CODE]<table border=’0′ cellspacing=’0′ cellpadding=’0′ style=’table-layout:fixed’ width=’80%’>[/CODE]

And this is where I’m at now, but it’s not valid CSS and its not showing up right:

[CODE]table {table-layout:fixed; width:80%; border-width:0; cellspacing:0; cellpadding:0;}[/CODE][CODE]<table>[/CODE]

Anyone know what I’m doing wrong? Thanks for any help.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@Wart_HogJan 19.2005 — I think that this is the effect that you are going for:

[code=php]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
body { background-color: #000; }
#table { table-layout:fixed; width:80%; background-color: #fff; padding:0; }
#table td { background color: white; border-width: 0; }
</style>
</head>

<body>

<table id="table">
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
</table>

</body>
</html>
[/code]


This will create a table that has no borders using valid css.
×

Success!

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