Results 1 to 5 of 5

Thread: Add css style to pagination

  1. #1
    Join Date
    Mar 2008
    Location
    Iceland
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Add css style to pagination

    hi
    how can i do this, add digg css style to pagination

    here is the css digg style, demo http://www.mis-algoritmos.com/2007/0...ur-pagination/
    Code:
    /*CSS Digg style pagination*/
        div.pagination {
            padding: 3px;
            margin: 3px;
            text-align:center;
        }
        
        div.pagination a {
            padding: 2px 5px 2px 5px;
            margin: 2px;
            border: 1px solid #AAAADD;
            
            text-decoration: none; /* no underline */
            color: #000099;
        }
        div.pagination a:hover, div.digg a:active {
            border: 1px solid #000099;
    
            color: #000;
        }
        div.pagination span.current {
            padding: 2px 5px 2px 5px;
            margin: 2px;
            border: 1px solid #000099;
            
            font-weight: bold;
            background-color: #000099;
            color: #FFF;
        }
        div.pagination span.disabled {
            padding: 2px 5px 2px 5px;
            margin: 2px;
            border: 1px solid #EEE;
        
            color: #DDD;
        }
    i have working pagination code, and at botton is this code
    Code:
    <table>
        <tr>
            <td><?=($cPage > 1 ? '<a href="?sida=1">&lt;&lt;</a>' : '&lt;&lt;')?></td>
            <td><?=($cPage > 1 ? '<a href="?sida='.($cPage-1).'">&lt;</a>' : '&lt;')?></td>
            <td>Síða <?=$cPage;?> af <?=$cPages;?></td>
            <td><?=($cPage != $cPages ? '<a href="?sida='.($cPage+1).'">&gt;</a>' : '&gt;')?></td>
            <td><?=($cPage != $cPages ? '<a href="?sida='.$cPages.'">&gt;&gt;</a>' : '&gt;&gt;')?></td>
        </tr>
    </table>
    how can add this style in ?

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Ummm... you have the css working but just not here or you dont have css working at all if the latter then try...
    Code:
    <div class="pagination">
    <table>
        <tr>
            <td><?=($cPage > 1 ? '<a href="?sida=1">&lt;&lt;</a>' : '&lt;&lt;')?></td>
            <td><?=($cPage > 1 ? '<a href="?sida='.($cPage-1).'">&lt;</a>' : '&lt;')?></td>
            <td>Síða <?=$cPage;?> af <?=$cPages;?></td>
            <td><?=($cPage != $cPages ? '<a href="?sida='.($cPage+1).'">&gt;</a>' : '&gt;')?></td>
            <td><?=($cPage != $cPages ? '<a href="?sida='.$cPages.'">&gt;&gt;</a>' : '&gt;&gt;')?></td>
        </tr>
    </table>
    </div>
    If that doesn't work try posting all of your code

  3. #3
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This dont seems to be working, here is full code of the page.
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=ISO-8859-1" />

    <title></title>
    <style type="text/css">
    /*CSS Digg style pagination*/
        div.pagination {
            padding: 3px;
            margin: 3px;
            text-align:center;
        }
        
        div.pagination a {
            padding: 2px 5px 2px 5px;
            margin: 2px;
            border: 1px solid #AAAADD;
            
            text-decoration: none; /* no underline */
            color: #000099;
        }
        div.pagination a:hover, div.digg a:active {
            border: 1px solid #000099;

            color: #000;
        }
        div.pagination span.current {
            padding: 2px 5px 2px 5px;
            margin: 2px;
            border: 1px solid #000099;
            
            font-weight: bold;
            background-color: #000099;
            color: #FFF;
        }
        div.pagination span.disabled {
            padding: 2px 5px 2px 5px;
            margin: 2px;
            border: 1px solid #EEE;
        
            color: #DDD;
        }
    </style>
    </head>

    <body>

    <h3></h3>

    <?php
    $dbHost 
    "localhost";
    $dbUser "";
    $dbPass "";
    $dbname "";

    $db mysql_connect($dbHost,$dbUser,$dbPass);
    mysql_select_db($dbname,$db);

    ## Start Paging
    ##
    $cPerPage 10;             // Hversu margar færslur á síðu
    $cTotal   mysql_num_rows(mysql_query("SELECT * FROM guestbook")); // Heildar færslur
    $cPage = (isset($_GET["sida"]) ? $_GET["sida"] : 1);    // Á hvaða síðu ertu staddur ? enginn = 1
    $cPages ceil$cTotal $cPerPage );
    ## Búum til MySQL Limit str
    $cStart = ($cPage $cPerPage) - $cPerPage;
    $cEnd   $cStart $cPerPage;
    $cLimit "LIMIT $cStart,$cEnd";


    $requete "SELECT ID, name, email, dateposted, comment
    FROM guestbook ORDER BY ID desc 
    $cLimit";


    $result mysql_query ($requete,$db);

    while(
    $row mysql_fetch_assoc($result))
    {
    $name $row['name'];
    $email $row['email'];
    $comment $row['comment'];
    $datetime $row["dateposted"];

    if (
    $email)
    echo 
    '<a href="mailto:'.$email.'">';
    echo 
    $name;
    if (
    $email)
    echo 
    '</a>';
    echo 
    ' - P&ograve;sta&eth; &THORN;ann '.$datetime.'<br />';
    echo 
    ''.$comment.'';
    echo 
    '<hr />';
    }


    ?>

    <center>
    <div class="pagination">
    <table>
        <tr>
            <td><?=($cPage '<a href="?sida=1">&lt;&lt;</a>' '&lt;&lt;')?></td>
            <td><?=($cPage '<a href="?sida='.($cPage-1).'">&lt;</a>' '&lt;')?></td>
            <td>Síða <?=$cPage;?> af <?=$cPages;?></td>
            <td><?=($cPage != $cPages '<a href="?sida='.($cPage+1).'">&gt;</a>' '&gt;')?></td>
            <td><?=($cPage != $cPages '<a href="?sida='.$cPages.'">&gt;&gt;</a>' '&gt;&gt;')?></td>
        </tr>
    </table>
    </div>
    </center>


    </body>
    </html>

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Use this with that css and work backwards

    <p><a href="http://www.digg.com">Digg</a> Style (<a href="http://www.mis-algoritmos.com/wp-content/uploads/pagstyle.php?q=digg">Download CSS</a>)
    <div class="digg"><span class="disabled">◄</span><span class="current">1</span><a href="#?page=2">2</a><a href="#?page=3">3</a><a href="#?page=4">4</a><a href="#?page=5">5</a><a href="#?page=6">6</a><a href="#?page=7">7</a>...<a href="#?page=199">199</a><a href="#?page=200">200</a><a href="#?page=2" class="next">►</a></div>

  5. #5
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thx for this, working great, thx

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •