jrrj07 jrrj07 - 1 month ago 7
CSS Question

TD Borders from a table, not showing in IE8


Possible Duplicate:

CSS to make an empty cell’s border appear?




I know this question has been asked a lot before, I tried adding &nbsp between every
<td> </td>
tags and it didn't work well, I'm guessing there's some kind of problem in the CSS, but I haven't been able to spot it, my tables shows alright with Firefox and Chrome, but whenever I try with IE8, there are some borders missing. HTML and table's CSS below, as well as screenshots.
The HTML of the table, was generated from a PHP Script.

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<!--[if IE]>
<link rel ="stylesheet" type ="text/css" href ="layout_ie.css"/>
<![endif]-->

<!--[if !IE]> -->
<link rel ="stylesheet" type ="text/css" href ="layout.css"/>
<!-- <![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Calendario de Capacitaciones</title>
</head>
<body>

<table cellpadding="0" cellspacing="0" class="calendar">
<tr class = "calendar-row">
<td class = "calendar-day-head">Lunes</td>
<td class = "calendar-day-head">Martes</td>
<td class = "calendar-day-head">Miércoles</td>
<td class = "calendar-day-head">Jueves</td>
<td class = "calendar-day-head">Viernes</td>
<td class = "calendar-day-head">Sábado</td>
<td class = "calendar-day-head">Domingo</td>
</tr>
<tr class = "calendar-row">

<td class ="calendar-day-np">&nbsp; </td>
<td class ="calendar-day-np">&nbsp; </td>
<td class ="calendar-day-np">&nbsp; </td>
<td class ="calendar-day-np">&nbsp; </td>
<td class ="calendar-day-np">&nbsp; </td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">1</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">2</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
</tr>


<tr class="calendar-row">
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">3</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">4</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">5</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">6</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">7</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">8</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">9</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
</tr>

<tr class="calendar-row">
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">10</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">11</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">12</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">
&nbsp<div class = "day-number">13</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">14</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">15</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">16</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

</tr>
<tr class="calendar-row">
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">17</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">18</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">19</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">20</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">21</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">22</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">23</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
</tr>

<tr class="calendar-row">
<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">24</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">25</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">26</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">27</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">28</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">29</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>

<td bgcolor="#FFFFFB" class = "calendar-day">&nbsp
<div class = "day-number">30</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
</tr>
<tr class="calendar-row">
<td bgcolor="#FFFFFB" class = "calendar-day">
&nbsp<div class = "day-number">31</div><p>&nbsp;</p><p>&nbsp;</p>&nbsp
</td>
<td class = "calendar-day-np">&nbsp;</td>
<td class = "calendar-day-np">&nbsp;</td>
<td class = "calendar-day-np">&nbsp;</td>
<td class = "calendar-day-np">&nbsp;</td>
<td class = "calendar-day-np">&nbsp;</td>
<td class = "calendar-day-np">&nbsp;</td>
</tr>
</table>

</body>
</html>


CSS

table.calendar {table-layout:fixed;margin-top:5em ;margin-left:15em; border-left:1px solid #999; }
tr.calendar-row { }
td.calendar-day { min-height:80px; font-size:11px; position:relative;border:1px solid #999; } * html div.calendar-day { height:80px; }
td.calendar-day:hover { background:#eceff5; }
td.calendar-day-np { background:#eee; min-height:80px; } * html div.calendar-day-np { height:80px; }
td.calendar-day-head { background:#ccc; font-weight:bold; text-align:center; width:135px; padding:5px; border-bottom:1px solid #999; border-top:1px solid #999; border-right:1px solid #999; }
div.day-number { background:#999; padding:5px; color:#fff; font-weight:bold; float:right; margin:-5px -5px 0 0; width:20px; text-align:center; }
/* shared */
td.calendar-day, td.calendar-day-np { max-width:50px; padding:5px; border-bottom:1px solid #999; border-right:1px solid #999; }


Screenshots:

How it looks in IE8.

http://i.stack.imgur.com/j7w6H.jpg

How it should look, (taken from Firefox).

http://i.stack.imgur.com/T0xzI.png

Answer

Try to do this in your CSS:

td.calendar-day {
min-height:80px; 
font-size:11px;
border:1px solid #999 !important;
}
Comments