iNamik
  The Pursuit of Excellence in the Software Development Lifecycle
 
Home
Projects
Downloads
FAQ
Old News
About
Links
Contact
 
iNamik TableFormatter

What Is It?
iNamik TableFormatter is a simple set of classes to help print text in tabulated form.

With these classes you can organize 'cells' of data into rows and columns. Each cell can contain multiple lines of text and may specify a horizontal alignment (left, center, right) and a vertical alignment (top, center, bottom).

When you are ready to print the data, these classes will ensure that all cells in a given column have the same width and all cells in a given row have the same height.

What License Is It Released Under?
iNamik GetOpt is currently released under the GNU General Public License .

How Do I Use It?
You can look at an example program to get a feel for how the TableFormatter works. The output of the example program is below.

NOTE: The border is optional

	         1         2         3         4
	1234567890123456789012345678901234567890
1	+-+----------+-+----------+-+----------+
2	|.|..........| |..........| |..........|
3	+-+----------+-+----------+-+----------+
4	|.|Left      | |          | |          |
5	|.|Top       | |Left      | |          |
6	|.|          | |Center    | |Left      |
7	|.|          | |          | |Bottom    |
8	+-+----------+-+----------+-+----------+
9	| |          | |          | |          |
10	+-+----------+-+----------+-+----------+
11	|.|  Center  | |          | |          |
12	|.|   Top    | |  Center  | |          |
13	|.|          | |  Center  | |  Center  |
14	|.|          | |          | |  Bottom  |
15	+-+----------+-+----------+-+----------+
16	| |          | |          | |          |
17	+-+----------+-+----------+-+----------+
18	|.|     Right| |          | |          |
19	|.|       Top| |     Right| |          |
20	|.|          | |    Center| |     Right|
21	|.|          | |          | |    Bottom|
22	+-+----------+-+----------+-+----------+

Table size = 40 x 22
					

Todo
  • Not sure there needs to be an interface.
  • Considering seperating the row/table formatting methods into a different class/interface. Maybe change the name to TextTable and then create a seperate TableFormatter class.
  • Also considering just moving the class as is into SimpleTextTable, which would leave room for a ComplexTextTable that might allow more control over the table formatting (i.e. Specifying max column widths and/or word wrap)