Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating borderless tables in IE

Status
Not open for further replies.

hungry

Programmer
Jul 18, 1999
6
0
0
US
Hi,

I'd like to create a table with no borders but which has whitespace (or actually background) between the cells. I want it to look like the navigation bar at the top of the Tek-Tips pages.

In Netscape, I do like this:
<table border=0 bgcolor=&quot;gray&quot; cellspacing=2>
<tr><td>cell 1</td><td>cell 2</td></tr>
</table>

But the same code in IE just results in one continuous block of the table foreground color. I.e., there's no background showing between cells.

Does anyone know how to fix this?
Thanks,
Ben Logan
 
In IE defining the table bgcolor will set everything behind the table to gray (including the spaces that show through between cells). You need to move the colour attribute into the row (or cell) element (eg <tr bgcolor=gray>). This should fix the problem.

And if you are doing alot of tables you might find it easier to use a style sheet to define the <tr> element as having a gray background to save a bit of space (not to mention making editing easier), so ...

<style>
tr {background:gray}
</style>

hope it helps :)
gollyg
 
If you can grab hold of Macromedia Dreamweaver, your problem is solved without having to know the code behind it.
You can put your table in and modify your size and cell color by dragging and clicking. :)


Soon
 
An other way would be

<TD>&amp;nbsp;</TD>

hnd
hasso55@yahoo.com

 
<table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; bgcolor=&quot;#FFFFFF&quot;>
<tr><td>
<table border=&quot;0&quot;>
<tr>
<td bgcolor=&quot;#999999&quot;></td>
<td bgcolor=&quot;#456789&quot;></td>
</tr>
<tr>
<td bgcolor=&quot;#987654&quot;></td>
<td bgcolor=&quot;#223344&quot;></td>
</tr>
</table>
</td></tr>
</table>
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Hi

I wanted to display a Table Dynamically on the web page in 2 columns
Eg:

column1 column2
data1 data2

I tried with the following code but it did not work
FORM1.Document.body.insertAdjacentHTML &quot;BeforeEnd&quot;, _
&quot;<table>&quot;
FORM1.Document.body.insertAdjacentHTML &quot;BeforeEnd&quot;, _
&quot;</table>&quot;

and with
document.body.outerHTML = &quot;<Table border = 100>&quot;
document.body.outerHTML =&quot;</Table> &quot;

but it did not give me any result
it would be great if some one could help me with it
Thanks

 
give us a link to all your code. jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top