Showing posts with label remainder. Show all posts
Showing posts with label remainder. Show all posts

Monday, 18 April 2011

ASP: resulting recordset in two columns

   


Today I am going to show you a little trick: how to display your recordset data in two columns. And to do so, we will use the MOD remainder function.
Let me make things more clear. We assume we are getting data from a database consisting in a single column recordset. Something like:

Name 1
Name 2
Name 3
Name 4
Name 5

Regardless the number of rows, what we want is to display data the following way:

Name 1Name 2
Name 3Name 4
Name 5

How do we do it? Believe me it is very simple.