Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2005, 02:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default Force somthing invisble into table cell

Well, I have a slight blemish in a piece of HTML which I use for an ASP.NET control. The problem is that a table cell is constructed with borders to hold a javascript menu, which is placed in a span.

When the control is rendered the browser doesn't recognize that the table cell holds anything why the browser dosen't draw the borders (both IE and Firefox); i.e. the table cell has to have content in order to make the borders visible.

Therefore a tried to put in a   or anything else to force some non-visible content into the cell. This works fine in IE, but in Firefox the menu is pushed. The code underneath demonstrate the problem...
Code:
<table>
<tr>
    <td style="border:solid 1px #000000; background-color:#eeeeee;"></td>
    <td style="border:solid 1px #000000; background-color:#eeeeee;">&nbsp</td>
    <td style="border:solid 1px #000000; background-color:#eeeeee;">1</td>
</tr>
</table>
Only borders on the last two cells will appear. And I want borders on all three. This is probably a well-known problem, but someone must have solved it.

Is there a way to tell a table cell that it should draw the border eventhough there are no content?

Thanks, Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old October 30th, 2005, 03:00 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Found a solution, but is there another more correct method? The solution I found is shown in the code below, where the tag for a line is used...
Code:
<table>
<tr>
    <td style="border:solid 1px #000000; background-color:#eeeeee;"></td>
    <td style="border:solid 1px #000000; background-color:#eeeeee;">&nbsp</td>
    <td style="border:solid 1px #000000; background-color:#eeeeee;">1</td>
</tr>
</table>
The problem is that the color attribute has to be set according to the background color of the cell, table or page. Hope there is another way to do this.

Thanks, Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force table cell to a certain width? TheMajor HTML Code Clinic 1 April 17th, 2007 01:57 PM
layers in table cell dearmisskat HTML Code Clinic 12 March 10th, 2007 04:46 AM
reading from a table cell? Atomsk Access VBA 2 September 28th, 2006 07:46 AM
Hyperlink in a cell table amc Dreamweaver (all versions) 33 August 5th, 2004 12:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.