Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8517687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:46:27+00:00 2026-06-11T05:46:27+00:00

How to delete a column using below code. I’m using jquery and joomla. jQuery(a.coldelete).live(click,

  • 0

How to delete a column using below code. I’m using jquery and joomla.

jQuery("a.coldelete").live("click", function(){
                    var Index = jQuery(this).closest("th").prevAll("th").length;
                    var CostIndex = Index *2 - 1;
                    var SaleIndex = Index *2; 
                    alert(Index+'-'+CostIndex+'-'+SaleIndex);

                    jQuery("#ratecardlist").find("th:eq("+Index+")").remove();

                    jQuery("#labelrow").find("td:eq("+CostIndex+")").remove();
                    jQuery("#labelrow").find("td:eq("+SaleIndex+")").remove();

                    jQuery("#ratecardlist").find("tr.ratedatarow").each(function(){
                          jQuery(this).find("td:eq("+CostIndex+")").remove();
                          jQuery(this).find("td:eq("+SaleIndex+")").remove();
                    });
              });

HTML structure is mentioned below which is to be manipulated by jquery.

<table id="cardlist" class="admintable">
    <tbody>
        <tr>
            <th>Show Time</th>
            <th colspan="2" style="text-align:left;">A Full <a href="#ratecardinfo" class="coldelete"><img src="com/assets/images/remove.png" /></a></th>
            <th colspan="2" style="text-align:left;">A Half <a href="#ratecardinfo" class="coldelete"><img src="com/assets/images/remove.png" /></a></th>
            <th colspan="2" style="text-align:left;">B Full <a href="#ratecardinfo" class="coldelete"><img src="com/assets/images/remove.png" /></a></th>
            <th colspan="2" style="text-align:left;">B Half <a href="#ratecardinfo" class="coldelete"><img src="com/assets/images/remove.png" /></a></th>
            <th colspan="2" style="text-align:left;">C Full <a href="#ratecardinfo" class="coldelete"><img src="com/assets/images/remove.png" /></a></th>
            <th></th>
        </tr>
        <tr id="labelrow">
            <td>&nbsp;</td>
            <td width="80px"><label>COST</label></td>
            <td width="80px"><label>SALE</label></td>
            <td width="80px"><label>COST</label></td>
            <td width="80px"><label>SALE</label></td>
            <td width="80px"><label>COST</label></td>
            <td width="80px"><label>SALE</label></td>
            <td width="80px"><label>COST</label></td>
            <td width="80px"><label>SALE</label></td>
            <td width="80px"><label>COST</label></td>
            <td width="80px"><label>SALE</label></td>
            <td></td>
        </tr>
        <tr class="ratedatarow" id="rate15">
            <td>6:30 PM</td>
            <input type="hidden" value="15" name="showtimeids[]" /><input type="hidden" value="101" name="categoryids[]" />
            <td width="50px"><input type="text" value="650.00" name="fc:15:101" style="width:45px;" /></td>
            <td width="50px"><input type="text" value="670.00" id="fs_15_101" name="fs:15:101" style="width:45px;" /></td>
            <td width="50px"><input type="text" value="500.00" name="hc:15:101" style="width:45px;" /></td>
            <td width="50px"><input type="text" value="520.00" name="hs:15:101" id="hs_15_101" style="width:45px;" /></td>
            <input type="hidden" value="102" name="categoryids[]" />
            <td width="50px"><input type="text" value="400.00" name="fc:15:102" style="width:45px;" /></td>
            <td width="50px"><input type="text" value="420.00" id="fs_15_102" name="fs:15:102" style="width:45px;" /></td>
            <td width="50px"><input type="text" value="300.00" name="hc:15:102" style="width:45px;" /></td>
            <td width="50px"><input type="text" value="320.00" name="hs:15:102" id="hs_15_102" style="width:45px;" /></td>
            <input type="hidden" value="103" name="categoryids[]" />
            <td width="50px"><input type="text" value="1200.00" name="fc:15:103" style="width:45px;" /></td>
            <td width="50px"><input type="text" value="1240.00" name="fs:15:103" id="fs_15_103" style="width:45px;" /></td>
            <td><a onclick="removeRow('rate15');" href="#ratecardinfo" id="rem"><img src="com/assets/images/remove.png" /></a> <a id="mo_applytoall" onclick="applyToAll('rate15');" href="#ratecardinfo"> Apply to All </a></td>
        </tr>
        <tr>
            <td style="background-color:#DDDDDD;" colspan="11"></td>
            <td style="background-color:#DDDDDD;">
                <input type="submit" style="cursor:pointer;" value="Add Card" name="addratecard" />                    
                <input type="button" style="cursor:pointer;" onclick="resetAll();" value="Reset" />                      
                <input type="button" style="cursor:pointer;" onclick="clearAll();" value="Clear All" /> 
            </td>
        </tr>
    </tbody>
</table>

When I clicked the remove.png, the particular row should be removed.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:46:29+00:00Added an answer on June 11, 2026 at 5:46 am

    This seems to work..

    $("a").on("click", function(){
        $("table tbody tr").find("td:eq(0)").remove(); 
    });
    

    http://jsfiddle.net/peterbenoit/ymYpv/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written this code to delete duplicate rows in a column of an Excel
I am using below code to delete HTML Table row using javascript but its
I am trying to delete Empty rows by using below code: worksheet.Columns(A:A).SpecialCells(xlCellTypeBlanks).EntireRow.Delete The code
I wrote this very simple macro to delete all rows when Column P has
I am trying to generate the below code via T4. using System; using MyDAL;
i open UI dialog in this way: var $dialog = jQuery('#dialog'); $dialog.load('mySite.aspx'); $dialog.dialog({ autoOpen:
I want to delete or add column in sqlite database I am using following
I'm using the Ajax.ActionLink helper to generate a link to delete a record. This
If I had the following code and the user was to click the delete
Action buttons are added to jqGrid columns using colmodel below. Column width 45 is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.