<html>
<head>
<style>
.with_event {
background-color:red;
}
.atual {
background-color:green;
}
.dias {
background-color:gray;
padding:5px;
font-size:13px;
font-weight:bold;
position:absolute;
top: -5px;
left: 35px;
}
.calen td {
padding:20px;
position:relative;
}
</style>
<body>
<table class="calen">
<?php
$dias = Array( "20" => 5, "19"=>1, "13"=>2, "25"=> 1);
for ($at = 1; $at < $days; $at++){
if($at%7 == 1){
echo "</tr>";
echo "<tr>";
}
?>
<td class="calen_td
<?=$at==$atual?
'atual':''?> <?=isset($dias[$at])?
'with_event':''?>" data-dia="
<?=$at?>" data-month="
<?=$mes_atual?>">
<?=$at?> <?php if (isset($dias[$at])&& $dias[$at]>0) { ?> <span class="dias"><?=$dias[$at]?></span>
<?php } ?>
</td>
<?php
}
?>
</tr>
</table>
</body>
</html>
PGh0bWw+CjxoZWFkPgo8c3R5bGU+Ci53aXRoX2V2ZW50IHsKCWJhY2tncm91bmQtY29sb3I6cmVkOwp9CgouYXR1YWwgewoJYmFja2dyb3VuZC1jb2xvcjpncmVlbjsKfQoKLmRpYXMgewoJYmFja2dyb3VuZC1jb2xvcjpncmF5OwoJcGFkZGluZzo1cHg7Cglmb250LXNpemU6MTNweDsKCWZvbnQtd2VpZ2h0OmJvbGQ7Cglwb3NpdGlvbjphYnNvbHV0ZTsKCXRvcDogLTVweDsKICAgIGxlZnQ6IDM1cHg7Cn0KCi5jYWxlbiB0ZCB7CglwYWRkaW5nOjIwcHg7Cglwb3NpdGlvbjpyZWxhdGl2ZTsKfQoKPC9zdHlsZT4KPGJvZHk+Cjx0YWJsZSBjbGFzcz0iY2FsZW4iPgogIDw/cGhwCgkkZGlhcyA9IEFycmF5KCAiMjAiID0+IDUsICIxOSI9PjEsICIxMyI9PjIsICIyNSI9PiAxKTsKICAKICAKCSRkYXlzID0gZGF0ZSgidCIpOwoJJGF0dWFsID0gZGF0ZSgiZCIpOwoJJG1lc19hdHVhbCA9IGRhdGUoIm0iKTsKCglmb3IgKCRhdCA9IDE7ICRhdCA8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