1. A computer readable medium storing a computer program which when executed by at least one processor analyzes a document comprising a plurality of primitive elements, the computer program comprising sets of instructions for: identifying boundaries between sets of primitive elements; identifying that a plurality of the boundaries form a table; and defining a tabular structural element for the table, the tabular structural element comprising a plurality of cells arranged in a plurality of rows and columns, each cell comprising an associated set of primitive elements.