/    Sign up×
Community /Pin to ProfileBookmark

Hey! Mornin’ all!

Whats the best way for me to make a table with 2 columns and a border?

Thanks

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@pcthugFeb 08.2006 — You don't!

But cause you asked nicely:
[CODE]
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td>foo</td>
<td>bar</td>
</tr>
</table>
[/CODE]
Copy linkTweet thisAlerts:
@NogDogFeb 08.2006 — Just to give you some idea of the ways you can manipulate a table with CSS:
[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>Sample Table</title>
<style type="text/css">
body {
margin: 0;
padding: 1em;
font: medium arial, sans-serif;
}
table#test {
border-collapse: collapse;
border: solid 2px black;
margin: 0 auto;
}
#test td, #test th {
border: solid 1px black;
padding: 2px 4px;
}
#left {
width: 150px;
background-color: #ccffff;
}
#right {
width: 200px;
background-color: #ffffcc;
}
#heading {
background-color: #ffccff;
}
#test caption {
font-weight: bold;
text-align: center;
margin: auto;
}
</style>
</head>
<body>
<table id="test">
<caption>Table Caption</caption>
<colgroup>
<col id="left">
<col id="right">
</colgroup>
<tr id="heading">
<th>Column 1</th>
<th>Column 2</th>
</tr>
<tr>
<td>Row 1, Col 1</td>
<td>Row 1, Col 2</td>
</tr>
<tr>
<td>Row 1, Col 1</td>
<td>Row 1, Col 2</td>
</tr>
</table>
</body>
</html>
[/code]
×

Success!

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