HTML/CSS/Table Style/table footer

Материал из Web эксперт
Перейти к: навигация, поиск

Add extra row to the footer

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>

   <head>
       <title> My favorite records  </title>
       <style rel="stylesheet" type="text/css">

table {

   width: 100%;
   border: thin solid black;

} td {

   border: thin solid black;

} th, tfoot td {

   border: thin solid black;
   text-align: center;
   font-weight: bold;

} tbody td {

   font-size: 120%;

} caption {

   font-size: 90%;
   text-align: right;

} td, th, caption {

   padding: 5px;

}

       </style>
   </head>
   <body>
<colgroup> <col/> <col/> <col/> </colgroup> <thead> </thead> <tbody> </tbody> <tfoot> </tfoot>
Table: My favorite records.
Column 1 Column 2 Column 3
R T 1
B V 1
Q Q 1
M T 1
Column 1 Column 2 Column 3
   </body>

</html>

</source>
   
  


Only header and footer have border

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>

   <head>
       <title> My favorite records  </title>
       <style rel="stylesheet" type="text/css">

table {

   width: 100%;
   border: thin solid black;

} th, tfoot td {

   border: thin solid black;
   text-align: center;
   font-weight: bold;

} tbody td {

   font-size: 120%;

} caption {

   font-size: 90%;
   text-align: right;

} td, th, caption {

   padding: 5px;

} col#album {

   background: lightgrey;

} col#artist {

   width: 250px;

} col#released {

   width: 100px;
   background: lightgrey;

}

       </style>
   </head>
   <body>
<colgroup> <col/> <col/> <col/> </colgroup> <thead> </thead> <tbody> </tbody> <tfoot> </tfoot>
Table: My favorite records.
Column 1 Column 2 Column 3
R T 1
E V 1
Q Q 1
S P 1
Column 1 Column 2 Column 3
   </body>

</html>

</source>
   
  


Selecting cells in foot

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head>

   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <title></title>

<style type="text/css" media="Screen">

  1. t1 tfoot td {
 font-style: italic;

} </style> </head> <body>

<thead> </thead> <tfoot> </tfoot> <tbody class="b1"> </tbody>
c1 c2 c3 c4 c5 c6
c1 c2 c3 c4 c5 c6
r2 c1 c2 c3 c4 c5 c6

</body> </html>

</source>
   
  


Style for table footer

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head>

   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <title></title>

<style type="text/css" media="Screen"> table.example1 tfoot {

 background: red;
 color: white;

} </style> </head> <body>

Row Groups

<thead> </thead> <tfoot> </tfoot> <tbody> </tbody>
thead 2 3 4
tfoot 10 11 12
tbody 6 7 8

</body> </html>

</source>
   
  


Style for table footer: background, color and font

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head>

   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <title></title>
   <style type="text/css" title="text/css">

table {

 border-top: 1px solid #c9c9c9;
 border-left: 1px solid #c9c9c9;

} caption {

 padding: 0 0 10px;
 font: bold 120% Arial, sans-serif;
 text-transform: uppercase;

} th {

 text-align: left;
 font-weight: bold;

} th,td {

 border-bottom: 1px solid #c9c9c9;
 border-right: 1px solid #c9c9c9;
 font: 80% Verdana, Arial, sans-serif;
 padding: 2px 5px;

} tfoot {

 background-color: #666666;
 color: #dddddd;
 font-size: 80%;

} table {

 border: 1px solid #666666;

} tfoot td {

 border-bottom: 0;
 border-right: 0;

} </style> </head> <body>

<thead> </thead> <tfoot> </tfoot> <tbody>
       </tbody>
A list
S T A A P
Music
A2:35AA7
B2:35BB7
C2:35CC7
D2:35DD7
E2:35EE7
F2:35FF7
G2:35GG7
H2:35HH7
I2:35II7
J2:35JJ7
K2:35KK7
L2:35LL7

</body> </html>

</source>
   
  


Table footer style

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>

   <head>
       <title> My favorite records  </title>
       <style rel="stylesheet" type="text/css" >

table {

   width: 100%;
   border: thin solid black;
   caption-side: bottom;

} th, tfoot td {

   border: thin solid black;
   text-align: center;
   font-weight: bold;

} tbody td {

   font-size: 120%;

} caption {

   font-size: 90%;
   text-align: right;

} td, th, caption {

   padding: 5px;

}

       </style>
   </head>
   <body>
<colgroup> <col/> <col/> <col/> </colgroup> <thead> </thead> <tbody> </tbody> <tfoot> </tfoot>
Table: My favorite records.
Column 1 Column 2 Column 3
A T 1
C V 1
S Q 1
I P 1
Column 1 Column 2 Column 3
   </body>

</html>

</source>
   
  


table header foot

   <source lang="html4strict">

<?xml version"1.0" encoding="UTF-8"?> <!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>Using an alternate way to create a table</title>
 </head>
 <body>
<thead> </thead> <tfoot> </tfoot> <tbody> </tbody>
P S M L
# Pieces 8 12 16
Thin Crust 3.99 4.99 6.99
Deep Dish 4.99 6.99 8.99
Stuffed Crust 5.99 7.99 9.99

</body> </html>

</source>
   
  


tfoot tag is the last section of a table, which formats the table footer

   <source lang="html4strict">

<?xml version = "1.0"?> <!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>A simple XHTML table</title>
  </head>
  <body>
<tbody> </tbody> <tfoot> </tfoot>
Apple $0.25
Orange $0.50
Banana $1.00
Pineapple $2.00
Total $3.75
  </body>

</html>

</source>