How do I add an edit button on each row of a "tableselect" form element? How do I add an edit button on each row of a "tableselect" form element?

The code I have is the following one.

function example_elements_form() {
    $form = array();
    $header = array(
        'title' =&gt; array('field' =&gt; 'n.title', 'data' =&gt; t('Title')),
        'author' =&gt; array('field' =&gt; 'u.name', 'data' =&gt; t('Author')),
    );
    $query = "SELECT n.nid, n.title, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid". tablesort_sql($header);
    $result = pager_query(db_rewrite_sql($query));
    while($partial_node = db_fetch_object($result)) {
        $options[$partial_node-&gt;nid] = array(
            'title' =&gt; check_plain($partial_node-&gt;title),
            'author' =&gt; theme('username', $partial_node),
        );
    }
    if (!empty($options)) {
        $form['nodes'] = array(
            '#type' =&gt; 'tableselect',
            '#header' =&gt; $header,
            '#options' =&gt; $options,
        );
        $form['pager'] = array('#value' =&gt; theme('pager'));
        $form['submit'] = array(
            '#type' =&gt; 'submit',
            '#value' =&gt; t('Submit'),
        );
    }
    return $form;
}
Check out http://api.drupal.org/api/drupal/modules%21node%21node.admin.inc/function/node_admin_nodes/7

In particular, take a look at the lines that contain "operations". You need to set up a new element in $header to contain a column for the "operations", and then add at least one operation inside $options for each row.

You could either manually add a link to the edit with l(), or you could use module_invoke('node_operations') - again, an example of that is shown in the API.