Solved

CSS and HTML Table Issue

Posted on 2012-03-27
5
366 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

762 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

19 Experts available now in Live!

Get 1:1 Help Now