Set table border : table border « Tags « HTML / CSS






Set table border

   




<!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>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Colgroup 2</title>
<style>
td, th {
  border: 1px solid black;
}
</style>
</head>

<body>
<table>
<caption>Personal details</caption>
<colgroup style="background-color: #ccc;"></colgroup>
<colgroup></colgroup>
<colgroup span="3"></colgroup>
  <tr>
    <th rowspan="2">Name</th>
    <th rowspan="2">Place of residence</th>
    <th colspan="3">Date of birth </th>
  </tr>
  <tr>
    <th>dd</th>
    <th>mm</th>
    <th>yyyy</th>
  </tr>
  <tr>
    <td>P</td>
    <td>O</td>
    <td>14</td>
    <td>06</td>
    <td>1978</td>
  </tr>
  <tr>
    <td>V</td>
    <td>B</td>
    <td>12</td>
    <td>01</td>
    <td>1985</td>
  </tr>
  <tr>
    <td>L</td>
    <td>L</td>
    <td>01</td>
    <td>03</td>
    <td>1956</td>
  </tr>
  <tr>
    <td>E</td>
    <td>P</td>
    <td>28</td>
    <td>02</td>
    <td>1979</td>
  </tr>
</table>
</body>
</html>

   
    
  








Related examples in the same category

1.Collapsed Borders
2.table border-width: medium;
3.table border-color: navy;
4.table border groove
5.border-collapse: separate
6.border-collapse: collapse
7.using border-spacing to create space between cells in a table
8.Using the differing precedences of row, column and cell borders to style a table
9.border-spacing: 0.5em
10.Set table right and bottom border to solid
11.Add border spacing
12.Add border spacing for only top and bottom
13.Add border space to column
14.Separated Borders
15.Boxed Cells
16.Left table border
17.Right table border
18.Top table border
19.Bottom table border
20.'border' sets the thickness in pixels of the border around an element
21.'bordercolor' specifies the color of the element border
22.'bordercolordark' defines the darker shade of the border color
23.'bordercolorlight' Example
24.'frame' determines how to display a table's border frame
25.'rules' controls which portions of a table's borders are displayed
26.Set table border to collapse, 1px solid black
27.table border-style: solid;
28.table border-color: #999999;
29.table border: 1px solid #C5B798;
30.Using a table to display border styles
31.table border: 1px solid black;
32.table border: thin solid black;table-layout: auto;
33.table {border-collapse:separate;}
34.table border-spacing:2px 8px;
35.Using CSS for Table Borders
36.table border: 1px solid #d8d8d8;
37.table border: 1px solid mediumslateblue;
38.table border-collapse: collapse;
39.table border: 1px solid rgb(200, 200, 200);
40.table border-spacing: 15px;
41.table border-spacing: 0 15px;
42.table border-spacing: 15px 0;
43.Table border and cell border