Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter ignoOre

    (@ignoore)

    THIS is awesome! Thank you so much!

    Thread Starter ignoOre

    (@ignoore)

    Hi Tobias,

    it´s me again. So the Plugin on top works perfectly, but now there´s a new Problem:
    I am trying to have a :hover on the row and column when i am “mouseover” a tablecell. I already have a Javascript for that, but need therefor <colgroup> right after <caption> and befor the <thead> elements.

    Can you give me a hint (maybe for another plugin) how to make the code look like this:

    <table id="tablepress-12" class="tablepress tablepress-id-12">
    	<caption style="caption-side:bottom;text-align:left;border:none;background:none;margin:0;padding:0;">
    	</caption>
    
        <colgroup></colgroup>
        <colgroup class="slim"></colgroup>
        <colgroup class="slim"></colgroup>
        <colgroup class="slim"></colgroup>
    
    	<tbody class="row-hover">
    
    		<tr class="row-1 odd">
    			<td class="column-1"><div><span></span></div></td>
    			<td class="column-2"><div><span>SPALTE 1 Titel</span></div>/td>
    			<td class="column-3"><div><span>SPALTE 2 Titel</span></div></td>
    			<td class="column-4"><div><span>SPALTE 3 Titel</span></div></td>
    		</tr>
    
    		<tr class="row-2 even">
    			<td class="column-1">ZEILE 1 Titel</td>
    			<td class="column-2">12</td>
    			<td class="column-3">28</td>
    			<td class="column-4">32</td>
    		</tr>
    
    		<tr class="row-3 odd">
    			<td class="column-1">ZEILE 2 Titel</td>
    			<td class="column-2">11</td>
    			<td class="column-3">4</td>
    			<td class="column-4">25</td>
    		</tr>
    
    	</tbody>
    </table>

    Is there a way, to make a plugin find out how many columns a table have and add this number of <colgroup class=”slim”></colgroup> Tags?

    Thanks a lot again, you´re doing an awesome job!

    Thread Starter ignoOre

    (@ignoore)

    Anyway…thanks a lot for your helf! I really appreciate it.

    Thread Starter ignoOre

    (@ignoore)

    You´re right, of course 🙂

    Is it possible to take if ($table_id>0) out , so it´s automatically for all tables. And take $column_number in function table_add_span( $tablepress_cell_content, $table_id, $row_number, $column_number ) out, to have less code? I mean like:

    add_filter( 'tablepress_cell_content', 'table_add_span', 10, 4 );
    	function table_add_span( $tablepress_cell_content, $table_id, $row_number ) {
    		if ($row_number==1) {
    		  $temp=$tablepress_cell_content;
    		  $tablepress_cell_content = "<span>".$temp."</span>";
    		}
    	  }
    	  return $tablepress_cell_content;
    	}
    Thread Starter ignoOre

    (@ignoore)

    Hey Tobias,

    thank you for the very fast hint! I hope I did it the right way, actually it looks so:

    add_filter( 'tablepress_cell_content', 'table_add_span', 10, 4 );
    	function table_add_span( $tablepress_cell_content, $table_id, $row_number, $column_number ) {
    	  if ($table_id>0) {
    		if ($column_number==1) {
    		  $temp=$tablepress_cell_content;
    		  $tablepress_cell_content = "<span>".$temp."</span>";
    		}
    	  }
    	  return $tablepress_cell_content;
    	}

    Could you maybe just tell me if the code seems to be ok? And for the $accepted_args I just took “4”, like the guys in the Thread you showed me did. Actually I have no idea what number I should add in there.

Viewing 5 replies - 1 through 5 (of 5 total)