-2

i created a site, And added pages to my site, since page size exceeds i need to create pagination in html i have created this method

<a href="page1.html">1</a><a href="page2.html">2</a><a href="page3.html">3</a>

in this way i created

Problem is when i add new page i need to replace all code again like this

<a href="newpage1.html">1</a><a href="page1.html">2</a><a href="page2.html">3</a><a href="page3.html">4</a>

ever time when i add new page i need to replace all code is ther a way to do this without PHP

Can sombody help me any idea to do this in html

romman
  • 201
  • 2
  • 4
  • 15

4 Answers4

1

Do not re-invent the wheel. Use datatables, they provide sorting, pagination (client side and server side), export and a number of additional features.

 http://datatables.net/

Include the files and just add this.

  $(document).ready(function() {
     $('#example').dataTable();
 } );

This is a very basic and good example, you should go for it.

http://datatables.net/examples/data_sources/dom.html

Danyal Sandeelo
  • 12,196
  • 10
  • 47
  • 78
0

This cannot be done purely in HTML. You must use something like PHP, or you could use Javascript.

jdu
  • 581
  • 2
  • 3
0

You can make just one HTML file called "Pagination.html" include all your links there and then include that Pagination on every page using one of the following methods.

You can use Javascript: javascript

Or you can use html5: html5

Or there are also, others solutions to solve your problem like this: other

You better use some Javascript oriented solution, html5 support for including files still very poor.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
lcjury
  • 1,158
  • 1
  • 14
  • 26
-1

unfortunately, this won't be possible without using some other technology that is not HTML. You can dynamically generate pages using javascript (JS), PHP or other technology, but not just raw HTML.

You can name your pages something like:

page_1.html page_2.html

and then whichever editor you are using probably has a search & replace function, so you could use that to speed up things. I hope this helps.

perrysetgo
  • 73
  • 1
  • 10