Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   WP-Table Reloaded code insert (http://forum.bytesforall.com/showthread.php?t=14412)

johnnybravo May 30, 2011 03:46 AM

WP-Table Reloaded code insert
 
Hello from Russia!!!
I have to insert this code to change the width of one column of my table.
Code:

/* Using aoColumns */
$(document).ready(function() {
        $('#example').dataTable( {
                "aoColumns": [
                        { "sWidth": "20%" },
                        null,
                        null,
                        null,
                        null
                ]
        } );
} );

Please, tell me where this code to insert?
When I create a page that I put only the code table [table id=5 /]

juggledad May 30, 2011 03:56 AM

What version of Atahualpa and WP?
What is the URL?
What table?

johnnybravo May 30, 2011 04:14 AM

atahualpa 3.6.7 WP 3.1.3
http://pcs-nv.ru/?page_id=452
This table is imported from csv using the plugin WP-Table Reloaded. If you look at the third column (only in Opera 11.11), we can see that the numbers are shifted to the second line. I need to set a fixed width of the third column. To do this I need to add code that I wrote above.
Description of the code I took from here sWidth

johnnybravo May 30, 2011 04:38 AM

Please note that the problems with the tables are observed only in Opera. In other browsers, it is no problem.

juggledad May 30, 2011 04:56 AM

it may be that opera does not yet support this code. where did you put the code to make it work in the other browsers?

johnnybravo May 30, 2011 05:17 AM

The code I have nowhere to insert, because I do not know where. In other browsers, and without this code, everything works fine. only in Opera's column width is small. I need to register this code to column width has been fixed.

juggledad May 30, 2011 05:31 AM

where does the site you got the code from say it should be iserted?
In the header?
in the body?
you can use the ato->Add HTML/CSS Inserts options depending on where it should go.

I took a quick look at the site you got the code from, but i can't devote the time to dig thru and find out where it should go on a page, you will have to do that or ask on their forum.

johnnybravo May 30, 2011 05:35 AM

Okay, thanks. Try to visit the Russian-speaking forums.

johnnybravo May 31, 2011 02:35 AM

Hello.
I want to talk about solving my problem.
In a section of the plugin settings have JavaScript settings. This code must be inserted into user commands.
But the code should not be the one that I cited the example above.
It should be like this:
Code:

"aoColumnDefs": [{ "sWidth": "50px", "aTargets": [ 2 ] } ]
This code changes the width of the third column to a fixed size of 50 pixels. Why is [2]? Because the counter columns starting from zero.
This site has many useful functions. I recommend that you include jQuery (DataTables) in your template in the future.


All times are GMT -6. The time now is 08:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.