Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HTML TD Top Right X Click?

Posted on 2014-10-29
8
Medium Priority
?
155 Views
Last Modified: 2014-11-04
It seems the background image is the best way to place a clickable X in the top-right corner of a table td. I cannot have the entire td clickable.
Q. Would use a very small image and position to the right side?

Also need the click event fire a function which will remove the TD and it's one label.
0
Comment
Question by:WorknHardr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40411720
We might be able to help if we could see your code.  It's just guessing otherwise.  A TD is part of a table.  Removing one TD will have an effect on the rest of the table.
0
 

Author Comment

by:WorknHardr
ID: 40411896
Doing this from my iPhone. It's one master table with two side-by-side tables, each having several row items. The red-x click on each td containing the title label will remove its table. This leaves the master table with one less nested table.

<table id="master">
<tr>
<td>
<table>
    <tr><td><label>title1</label></td></tr>
    <tr><td>item1</td></tr>
    <tr><td>item2</td></tr>
 </table>
</td>
<td>
<table>
    <tr><td><label>title2</label></td></tr>
    <tr><td>item1</td></tr>
    <tr><td>item2</td></tr>
</table>
</td>
</tr>
</table>
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 40412205
Here is a very simple example with text instead of an image.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- HideTable.html -->
<title>Hide the Table</title>
<script type="text/javascript">
<!--
function hide1() {
	document.getElementById('table1').style.visibility = 'hidden';
	document.getElementById('table1').style.display = 'none';
	}

// -->
</script>
</head>
<body>
<h1>Hide the Table</h1>
<table id="master" width="240px" border="1">
<tr valign="top">
<td width="120px">
<div align="right" onclick="hide1()"><b>Click here</b></div>
<table id="table1">
    <tr><td><label>title1</label></td></tr>
    <tr><td>item1</td></tr>
    <tr><td>item2</td></tr>
 </table>
</td>
<td>
<table id="table2">
    <tr><td><label>title2</label></td></tr>
    <tr><td>item1</td></tr>
    <tr><td>item2</td></tr>
</table>
</td>
</tr>
</table>

</body>
</html>

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:WorknHardr
ID: 40414999
Nice, I need to use an image...
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40415064
Just put the image in place of "<b>Click here</b>".
0
 

Author Comment

by:WorknHardr
ID: 40415603
Got it, thx
0
 

Author Closing Comment

by:WorknHardr
ID: 40423274
Got it, thx
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40423319
You're welcome.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

718 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