View Full Version : Table Caption Help

07-06-2011, 04:47 PM
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:

<!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">
<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">
font-family: Verdana, Arial, Helvetica, sans-serif;
margin:50px 25px;
.shadow {
position: relative;
top: -1px;
left: -1px;
width: 660px;
margin: auto;
background: #000;
position: relative;
top: -3px;
left: -3px;
width: 660px;
border:1px solid #131313;
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;

<div class="shadow">
<table cellspacing="0">
<caption><img src="kulinarylogo.jpg" alt="KulinaryKidz" width="238" height="47" /><br />
Site Statistics<br /><br /><br /></caption>
<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>
<td class="left">May</td>
<td>2 (mins)</td>
<tr class="alt">
<td class="left">April</td>
<td>5 (mins)</td>
<td class="left">March</td>
<td>1 (mins)</td>
<tr class="alt">
<td class="left">Feb.</td>
<td>3 (mins)</td>
<td class="left">Jan.</td>
<td>1 (mins)</td>


07-06-2011, 04:51 PM
because that is what the caption tag does caption tag (http://www.w3schools.com/tags/tag_caption.asp) and to quote from the site (so you don't have to search for it)

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.

07-06-2011, 04:58 PM
My bad! I read through the chapter. Just ignore this thread!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum