Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-06-2011, 03:47 PM   PM User | #1
Dyl
New Coder

 
Join Date: Jun 2011
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Dyl is an unknown quantity at this point
Table Caption Help

This is my code so far and it does NOT work. It puts the caption above the table and doesn't include it inside the table:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Fix Table</title>
<meta http-equiv="Content-Language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
<!--
body{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	background-color:#75a54b;
	color:#f18359;
	margin:50px 25px;
}
.shadow {
	position: relative;
	top: -1px;
	left: -1px;
	width: 660px;
	margin: auto;
	background: #000;
}
table{
	position: relative;
	top: -3px;
	left: -3px;
	width: 660px;
	border:1px solid #131313;
	background-color:#ffffff;
	margin:auto;
}
table th {
	background-color: #FFC5AF;
	color: #75a54b;
}
table th, table td {
	margin: 0;
	padding: 0px 90px 0px 30px;
	text-align: center;
	border-bottom: 1px solid #b5b5b5;
}
table .left {
	text-align: left;
}
table tr.alt {
	background-color: #CCCCCC;
}
-->
</style>
</head>

<body>
<div class="shadow">
	<table cellspacing="0">
		<caption><img src="kulinarylogo.jpg" alt="KulinaryKidz" width="238" height="47" /><br />
			Site Statistics<br /><br /><br /></caption>
		<thead>
		<tr>
			<th class="left" scope="col"><strong>Month</strong></th>
			<th scope="col"><strong># of Visitors</strong></th>
			<th scope="col"><strong>Avg. Visit Stay</strong></th>
		</tr>
		</thead>
		<tbody>
		<tr>
			<td class="left">May</td>
			<td>258</td>
			<td>2 (mins)</td>
		</tr>
		<tr class="alt">
			<td class="left">April</td>
			<td>350</td>
			<td>5 (mins)</td>
		</tr>
		<tr>
			<td class="left">March</td>
			<td>150</td>
			<td>1 (mins)</td>
		</tr>
		<tr class="alt">
			<td class="left">Feb.</td>
			<td>125</td>
			<td>3 (mins)</td>
		</tr>
		<tr>
			<td class="left">Jan.</td>
			<td>50</td>
			<td>1 (mins)</td>
		</tr>
		</tbody>
	</table>
</div>
</body>

</html>
Dyl is offline   Reply With Quote
Old 07-06-2011, 03:51 PM   PM User | #2
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
because that is what the caption tag does caption tag and to quote from the site (so you don't have to search for it)
Quote:
The <caption> tag must be inserted immediately after the <table> tag. You can specify only one caption per table. Usually the caption will be centered above the table.
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Old 07-06-2011, 03:58 PM   PM User | #3
Dyl
New Coder

 
Join Date: Jun 2011
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Dyl is an unknown quantity at this point
My bad! I read through the chapter. Just ignore this thread!
Dyl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:06 PM.


Advertisement
Log in to turn off these ads.