Table cell background and align, indent : td align « Tags « HTML / CSS






Table cell background and align, indent

   


<!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 {
  width: auto;
  height: 1px;
  table-layout: auto;
  border-collapse: collapse;
  margin-left: 20px;
  border: 1px solid black;
}

td,th {
  width: 50px;
  height: 1px;
  overflow: hidden;
  visibility: visible;
  border: 1px solid black;
  padding: 5px;
  background: pink;
  text-align: center;
  vertical-align: middle;
  text-indent: 5px;
}
</style>
</head>
<body>
<h2>Simple Table</h2> 

<table> 
    <tr> <th>1</th> <th>2</th> <th>3</th> <th>4 </th> <th>5 </th> <th>6 </th> </tr> 
    <tr> <th>7</th> <td>8</td> <td>9</td> <td>10</td> <td>11</td> <td>12</td> </tr> 

</table> 


</body>
</html>

   
    
  








Related examples in the same category

1.Vertically aligned to the top of the cell
2.vertically aligned to the middle of the cell
3.vertically aligned to the bottom of the cell
4.Table cell vertical-align: baseline
5.table cell alignment
6.Table cell with vertical-align: top
7.Table cell with vertical-align: baseline
8.table cells with vertical alignment
9.td vertical-align: baseline;
10.td vertical-align: top;
11.td vertical-align: middle;
12.td vertical-align: bottom;