I have a jsp file ,like this :
<html>
<head>
<script type="text/javascript">
var type=<bean:write name="class" property="type" />
</script>
<style type="text/css">
.td-type1
{
width: 10mm;
}
.td-type2
{
width: 20mm;
}
</style>
</head>
<body>
<table>
<tr>
<td class="td-type1">
</td>
</tr>
</table>
</body>
</html>
My question is: How to change css dynamically base on type value? For example, if type equal 2, then the css class of td-type2 should be used for td tag. should I use .properties file to save all config or multi css files or ...?