I am trying to create an html table using css. The first column is to be in monospace font, as it contains computer code.
The font-family attribute does not seem to work, however. This is the html file:
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<table cellspacing="0" class="software">
<COLGROUP class="command">
<COLGROUP>
<tr>
<td>command 1</td>
<td>description</td>
</tr>
<tr>
<td>command 2</td>
<td>description</td>
</tr>
</table>
</body>
</html>
The corresponding css file contains the following:
table.software{
font-family: Arial;
font-size: 13pt;
border-width: 1px 1px 1px 1px;
border-style: solid;
}
table.software td{
text-align: left;
border-width: 1px 1px 1px 1px;
border-style: solid;
padding: 5px;
}
.command{
font-family: monospace;
font-size: 10pt;
width: 300;
}
I would be most grateful for a pointer of how to achieve the change of fonts. Thanks!
Greetings, Michael