Solved

CSS and HTML Table Issue

Posted on 2012-03-27
5
367 Views
Last Modified: 2012-03-27
Hi,

Having an issue with HTML and CSS.

I have created tables in several pages so that text.images can be displayed easier. Problem is I can hide the table border but not the column borders. I want all of the table borders to be invisible. See attachment.

My CSS code is:
table, td, th ,tr
{ border-style:hidden; empty-cells:hide; width:75%;

}

Open in new window


and my HTML code is:

 <table style="border:0px;" cellpadding="0"><tr style="border:0px;" cellpadding="0"><td style="border:0px;" cellpadding="0"> <p> With two Team Managers Karly Sherlock and Ben Simpson</p></td>
  <td style="border:inherit"><img src="images/demo/KarlySherlock.jpg" width="150" height="100" alt="Karly Sherlock" /></td><td style="border:inherit"><img src="images/demo/BenSimpson.jpg" width="150" height="100" alt="Ben Simpson" /></td></tr></table>

Open in new window


One last thing. This error only seems to be happening on IE, within Firefor and Safari its fine.

Cheers.
0
Comment
Question by:Simon2301
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37770799
try
border-style:none
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37770814
add this to your table style as well

border-collapse: collapse;
border:none;
0
 
LVL 12

Accepted Solution

by:
Tony van Schaik earned 300 total points
ID: 37773665
This should do the trick:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
table.noborders {
	border-collapse:collapse;
	margin:0px;
	padding:0px;
}
.noborders th, .noborders tr, .noborders td {
	border:none;
	vertical-align:top;
}
</style>
</head>

<body>
<table class="noborders" width="400" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img name="" src="" width="180" height="180" alt="" /></td>
    <td><img name="" src="" width="180" height="180" alt="" /></td>
  </tr>
</table>

</body>
</html>

Open in new window

0
 

Author Comment

by:Simon2301
ID: 37774014
@ TheRealTeune - A border still appears around the content.
0
 

Author Comment

by:Simon2301
ID: 37774091
OK ive just added
style="border:0px;"

Open in new window

so...
<table class="noborders" style="border:0px;" width="400" border="0" cellspacing="0" cellpadding="0">

Open in new window

and this works now. I will do further testing next few days for other browsers but it certainly fixes it for IE.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now