/    Sign up×
Community /Pin to ProfileBookmark

Basic newb question about CSS table formatting

How can I place a black border line above the “total” row in this table?

<html>
<head>
<style type=”text/css”>
#customers
{
width:100%;
border-collapse:collapse;
font-family: Tahoma;
font-size:13px;
}
#customers td, #customers th
{
padding:3px 7px 2px 7px;
background-color:#ffffff;
border-top: 1px solid #ffffff;
border-bottom: 1px solid #ffffff;
}
#customers th
{
text-align:left;
padding-top:5px;
padding-bottom:4px;
background-color:#ffffff;
}
#customers tr.alt td
{
color:#000000;
background-color:#ffffff;
}
#customers th.centerh
{
text-align:center;
}
#customers td.centerd
{
text-align:center;
}
</style>
</head>

<body>
<table id=”customers”>
<tr>
<th>Item</th>
<th>Manufacturer</th>
<th>Size</th>
<th class=”centerh”>Unit Price</th>
<th class=”centerh”>Quantity</th>
<th class=”centerh”>Total Price</th>
</tr>
<tr>
<td>Corn Flakes</td>
<td>Kellogg’s</td>
<td>18 oz.</td>
<td class=”centerd”>2.50</td>
<td class=”centerd”>1</td>
<td class=”centerd”>2.50</td>
</tr>
<tr class=”alt”>
<td>Solid White Tuna</td>
<td>Starkist</td>
<td>5 oz</td>
<td class=”centerd”>2.79</td>
<td class=”centerd”>2</td>
<td class=”centerd”>5.58</td>
</tr>
<tr>
<td>Cream of Mushroom Soup</td>
<td>Campbell’s</td>
<td>10.75 oz</td>
<td class=”centerd”>1.00</td>
<td class=”centerd”>2</td>
<td class=”centerd”>2.00</td>
</tr>
<tr class=”alt”>
<td>2% Lowfat Milk</td>
<td>Safeway</td>
<td>0.5 gal</td>
<td class=”centerd”>1.99</td>
<td class=”centerd”>1</td>
<td class=”centerd”>1.99</td>
</tr>
<tr>
<td>Extra-Wide Egg Noodles</td>
<td>Golden Grain</td>
<td>12 oz</td>
<td class=”centerd”>0.87</td>
<td class=”centerd”>3</td>
<td class=”centerd”>2.61</td>
<tr>
<td>Total</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class=”centerd”>9</td>
<td class=”centerd”>14.68</td>
</table>
</body>
</html>

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@TheAliveWinnerMar 03.2012 — [I]Use:[/I]
[code=html]<tr style="border-top-style:solid;">
<td>Total</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="centerd">9</td>
<td class="centerd">14.68</td>
</tr>[/code]
Copy linkTweet thisAlerts:
@spufiMar 03.2012 — [code=html]<tr id="total">
<td colspan="4">Total</td>
<td class="centerd">9</td>
<td class="centerd">14.68</td>
</tr>[/code]


Externally link the CSS.
Copy linkTweet thisAlerts:
@spufiMar 03.2012 — Also this...

<i>
</i>#customers th.centerh
{
text-align:center;
}
#customers td.centerd
{
text-align:center;
}


Should be this...

<i>
</i>.center
{
text-align:center;
}


No reason to get extra fancy.
×

Success!

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