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 7442467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:10:44+00:00 2026-05-29T11:10:44+00:00

I have a sortable table in html and looking to put an add.png inside

  • 0

I have a sortable table in html and looking to put an add.png inside each table header so if a user wants to add another url – they just click the add.png and redirects them to the addurl.php (if they click outside it will still sort the table just like normal). Right now it sorting when I click on the .png and/or outside it. If this something that can’t be done, I’ve also thought about trying to add a final row with [add another site] but have no idea how to work it into the $j++ so it appears at the final row.

what it looks like

[PHP snippet]

        <table class="datatable sortable selectable full">  
        <thead>
        <tr class="theader">
            <th width="100%">           
            <b><li><img src="images/logos/googlebuzz-2-icon.png" height="18" border="0" />Google <a href="addurl.php"><img src="img/icons/add.png" height="18" border="0" align="right"/></a></li></b>  
            </th>           
            <th>                        
            <b>Coins</b>            
            </th>
            <th>            
            <b>CPC</b>          
            </th>                   
        </tr>
        </thead>
        <tbody>             
<?
  $site2 = mysql_query("SELECT * FROM `sites` WHERE `user`='{$data->login}' ORDER BY `cpc` DESC");
  for($j=1; $site = mysql_fetch_object($site2); $j++)
{
?>      
            <tr>
                <td>                            
                <? if($site->banned == 1){ ?><font color="red"><? }else{ ?><font color="green"><? } echo($site->title); ?></font><a href="editurl.php?id=<? echo $site->id;?>" class="action-button-small" title="Edit URL"><span class="edit"></span></a>                  
                </td>                           
                <td align="right">                      
                <? if($site->points <= 10){ ?><font color="red"><? }else{ ?><font color="green"><? } echo($site->points); ?></font><a href="addcoins.php?id=<? echo $site->id;?>" class="action-button-small" title="Add Coins"><span class="add"></span></a>
                </td>
                <td>                
                <? echo $site->cpc;?>           
                </td>                   
            </tr>
            <?}?>
        </tbody>
</table>
  • 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-05-29T11:10:45+00:00Added an answer on May 29, 2026 at 11:10 am

    First of all, instead of a for loop, you should use while:

    while($site = mysql_fetch_object($site2))
    

    If you want to add a final row, just add it outside the iteration, before </tbody>:

    <tbody>
    <? while($site = mysql_fetch_object($site2)): ?>
      <tr>
        <td>                            
          <? if($site->banned == 1){ ?><font color="red"><? }else{ ?><font color="green"><? } echo($site->title); ?></font><a href="editurl.php?id=<? echo $site->id;?>" class="action-button-small" title="Edit URL"><span class="edit"></span></a>                  
        </td>                           
        <td align="right">                      
          <? if($site->points <= 10){ ?><font color="red"><? }else{ ?><font color="green"><? } echo($site->points); ?></font><a href="addcoins.php?id=<? echo $site->id;?>" class="action-button-small" title="Add Coins"><span class="add"></span></a>
        </td>
        <td>                
          <? echo $site->cpc;?>           
        </td>                   
      </tr>
    <? endwhile; ?>
      <tr>
        <td colspan="3">
          <a href="addurl.php">[add another site]</a>
        </td>
      </tr>
    </tbody>
    

    It seems you are using a javascript to do the sorting. I don’t know if that can be changed so your add button in the header works.

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

Sidebar

Related Questions

I have an HTML table: <table id=HatedByCSSOnlyGoons> <tr><td>Header 1</td><td>Header 2</td></tr> <tr><td>Data</td><td>Data</td></tr> <tr><td>Data</td><td>Data</td></tr> </table> and
I have a very simple HTML table, to which jQuery sortable is applied so
I have an HTML table that is marked as sortable() with jQuery-UI and the
In a html table I have in every row a cell with its own
I have produced a data table. All the columns are sortable. It has a
I have been working with jquery-ui's sortable demo for a while. On looking closely,
I'd like some help with the following jQuery code if possible... $(document).ready(function() { $('table.sortable').each(function()
I have an HTML table with less than 50 rows. I am using Sorttable
I have a sortable default table model with ListSelectionListener that listens for a doubleclick
I have a table I'm using jQuery UI's sortable on. In the table, I

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.