Pagination is the process of dividing (content) into discrete pages, either electronic pages or printed pages. Today the latter are usually simply instances of the former that have been outputted to a printing device, such as a desktop printer or a modern printing press. For example, printed books and magazines are created first as electronic files (for example, PDF or QXD files) and then printed. Pagination encompasses rules and algorithms for deciding where page breaks will fall, which depends on semantic or cultural senses of which content belongs on the same page with related content and thus should not fall to another (e.g., widows and orphans). Pagination is sometimes a part of page layout, and other times is merely a process of arbitrary fragmentation. The difference is in the degree of intelligence that is required to produce an output that the users deem acceptable or desirable. Before the rise of information technology (IT), pagination was a manual process, and print output was its sole purpose. Every instance of a pagination decision was made by a human. Today, most instances are made by machines, although humans often override particular decisions. As years go by, software developers continually refine the programs to increase the quality of the machine-made decisions (make them "smarter") so that the need for manual overrides becomes ever rarer.
In reference to books made in the pre-IT era, in a strict sense of the word, pagination can mean the consecutive numbering to indicate the proper order of the pages, which was rarely found in documents pre-dating 1500, and only became common practice circa 1550, when it replaced foliation, which numbered only the front sides of folios.
Pagination in word processing, desktop publishing, digital typesetting 
Word processing, desktop publishing, and digital typesetting are technologies built on the idea of print as the intended final output medium, although nowadays it is understood that plenty of the content produced through these pathways will be viewed onscreen by most users rather than being printed on paper.
All of these software tools are capable of flowing the content through algorithms to decide the pagination. For example, they all include automated word wrapping (to make line-ending decisions), machine-readable paragraphing (to make paragraph-ending decisions), and automated pagination (to make page-breaking decisions). All of those automated capabilities can be manually overridden by the human user, via soft-hyphening (that is, inserting a hyphen which will only be used if the word is split over two lines, and thus not shown on print if not), manual line breaks (that is, forced soft returns), hard returns, and manual page breaks.
Pagination in Web content (HTML, ASP, PHP, and others) 
On the Internet, pagination is used for such things as displaying a limited number of results on search engine results pages, or showing a limited number of posts when viewing a forum thread. Pagination is used in some form in almost every web application to divide returned data and display it on multiple pages. Pagination also includes the logic of preparing and displaying the links to the various pages.
Correctly implementing pagination can be difficult. There are many different usability questions such as should "previous" and "next" links be included, how many links to pages should be displayed, and should there be a link to the first and last pages. Also ability to define the number of records displayed in a single page is useful.
Separation of presentation and content and its effect on how we classify presentation media 
Today, all content, no matter which output medium is planned, predicted, or not predicted, can be produced with technologies that allow downstream transformations into any presentation desired, although such best-practice preparation is still far from universal. This usually involves a markup language (such as XML, HTML, or SGML) that tags the content semantically and machine-readably, which allows downstream technologies (such as XSLT, XSL, or CSS) to output them into whatever presentation is desired. This concept is known as the separation of presentation and content. This paradigm is now the conventional one in most commercial publishing, except to the extent that legacy and backward compatibility issues and budget constraints interfere, and to the extent that many of the people involved don't understand the topic enough to help build compliance. But it is no longer possible to make a hierarchical distinction between pagination in the print medium and pagination in the electronic medium, because print is merely an instance of presentation of the same underlying content.Pagination is very important...
See also 
- Mikheev, Oleg (28 August 2007). "Ajax programming with Struts 2". Network World, Inc. Retrieved 6 February 2009.
- Baptiste, Lyndon (30 November 2007). "Perfect PHP Pagination". SitePoint. Retrieved 6 February 2009.
- Gervasio, Alejandro (10 May 2005). "Previous or Next? Paginating Records with PHP – Part 3". Developer Shed. Retrieved 6 February 2009.
- Innovative, Php (3 February 2011). "PHP Pagination from Scratch". InnovativePhp. Retrieved 3 February 2011.