Originariamente inviato da dark0s
Come posso personalizzare la base dei campi di una tabella con i CSS?
ad esempio così
codice:
<!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" lang="it" xml:lang="it">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>xhtml 1.0</title>
<style type="text/css">
table, td, tr { margin: 0; padding: 0; border: 0; border-collapse: collapse; }
th, td { text-align: left; padding-left: 10px;}
#col1 { width: 100px; background: yellow; }
#col2 { width: 200px; background: red;}
#col3 { width: 400px; background: green;}
</style>
</head>
<body>
<table>
<col id="col1" />
<col id="col2" />
<col id="col3" />
<thead>
<tr>
<th>colonna 1</th>
<th>colonna 2</th>
<th>colonna 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>100px + 10</td>
<td>200px + 10</td>
<td>400px + 10</td>
</tr>
</tbody>
</table>
</body>
</html>
avendo cura di elimnare tutta la formattazione extra applicata dai vari browser
e usando il tag <col />