SAbboushi
asked on
I want border around table, tr and td
I'm not understanding why tr behaves differently. Why doesn't my code give a border around the rows too? I want a border around the table, tr and td (i.e. 3 levels of borders)
NOTE: My primary objective is not a workaround but to better understand css (i.e. if a workaround is required, I want the workaround in addition to an explanation of why my original code does not work!)
NOTE: My primary objective is not a workaround but to better understand css (i.e. if a workaround is required, I want the workaround in addition to an explanation of why my original code does not work!)
<!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">
<head>
<title>
THE TITLE
</title>
<style>
table, tr, td
{
border: 1px solid black;
}
td {
font-size: 26px;
color:red;
}
</style>
</head>
<body>
<table class="property_list">
<tr class="property_list_row">
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
</tr> </table>
</body>
</html>
ASKER
>> the TR tag does not have a css attribute of border
But neither does the TD tag
http://www.w3schools.com/t ags/tag_td .asp
So this doesn't explain to me why it works with TD but not TR
But neither does the TD tag
http://www.w3schools.com/t
So this doesn't explain to me why it works with TD but not TR
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
K thanks for your help. So is there a way to get the 3 levels of borders?
What do you mean 3 levels?
ASKER
I want a border around the table, tr and td (i.e. 3 levels of borders)
You cannot, the most you could have is 2 borders, the TR border would become the TD border.
ASKER
k thanks-
http://www.w3schools.com/tags/tag_tr.asp
FF and others respect it but IE does not (correctly so), so you have to use the border-collapse hack to make IE see it as a dimensionable object.