Abstract
Automatic layout of tables is required in online applications because of the need to tailor the layout to the viewport width, choice of font, and dynamic content. However, if the table contains text, minimizing the height of the table for a fixed maximum width is NP-hard. Thus, more efficient heuristic algorithms are required. We evaluate the HTML table layout recommendation and find that while it generally produces quite compact layout it is brittle and can lead to quite uncompact layout. We present an alternate heuristic algorithm. It uses a greedy strategy that starts from the widest reasonable layout and repeatedly chooses to narrow the column for which narrowing leads to the least increase in table height. The algorithm is simple, fast enough to be used in online applications, and gives significantly more compact layout than is obtained with HTML’s recommended table layout algorithm.
Supplemental Material
Available for Download
The proof is given in an electronic appendix, available online in the ACM Digital Library.
- Anderson, R. J. and Sobti, S. 1999. The table layout problem. In Proceedings of the 15th Annual Symposium on Computational Geometry (SCG’99). ACM Press, 115--123. Google Scholar
Digital Library
- Badros, G. J., Borning, A., Marriott, K., and Stuckey, P. 1999. Constraint cascading style sheets for the web. In Proceedings of the ACM Conference on User Interface Software and Technology. ACM, 73--82. Google Scholar
Digital Library
- Beach, R. J. 1985. Setting tables and illustrations with style. Ph.D. dissertation, University of Waterloo. Google Scholar
Digital Library
- Beaumont, N. 2004. Fitting a table to a page using non-linear optimization. Asia-Pac. J. Oper. Res. 21, 2, 259--270.Google Scholar
Cross Ref
- Bilauca, M. and Healy, P. 2010. A new model for automated table layout. In Proceedings of the 10th ACM Symposium on Document Engineering (DocEng’10). ACM, 169--176. Google Scholar
Digital Library
- Bilauca, M. and Healy, P. 2011. Building table formatting tools. In Proceedings of the 11th ACM Symposium on Document Engineering (DocEng’11). ACM, 13--22. Google Scholar
Digital Library
- Borning, A., Lin, R., and Marriott, K. 2000. Constraint-Based document layout for the web. Multimedia Syst. 8, 3, 177--189. Google Scholar
Digital Library
- Gange, G., Marriott, K., Moulder, P., and Stuckey, P. 2011. Optimal automatic table layout. In Proceedings of the 11th ACM Symposium on Document Engineering (DocEng’11). ACM, 23--32. Google Scholar
Digital Library
- Hurst, N. and Marriott, K. 2007. Approximating text by its area. In Proceedings of the ACM Symposium on Document Engineering (DocEng’07). 147--149. Google Scholar
Digital Library
- Hurst, N., Marriott, K., and Moulder, P. 2005. Towards tighter tables. In Proceedings of the ACM Symposium on Document Engineering (DocEng’05). ACM, 74--83. Google Scholar
Digital Library
- Hurst, N., Marriott, K., and Albrecht, D. 2006a. Solving the simple continuous table layout problem. In Proceedings of the ACM Symposium on Document Engineering (DocEng’06). ACM, 28--30. Google Scholar
Digital Library
- Hurst, N., Marriott, K., and Moulder, P. 2006b. Minimum sized text containment shapes. In Proceedings of the ACM Symposium on Document Engineering (DocEng’06). ACM, 3--12. Google Scholar
Digital Library
- Hurst, N., Li, W., and Marriott, K. 2009. Review of automatic document formatting. In Proceedings of the 9th ACM Symposium on Document Engineering. ACM, 99--108. Google Scholar
Digital Library
- Lin, X. 2006. Active layout engine: Algorithms and applications in variable data printing. Comput.-Aided Des. 38, 5, 444--456. Google Scholar
Digital Library
- Lutteroth, C. and Weber, G. 2006. User interface layout with ordinal and linear constraints. In Proceedings of the 7th Australasian User Interface Conference (AUIC’06). Australian Computer Society, 53--60. Google Scholar
Digital Library
- Page, L., Brin, S., Motwani, R., and Winograd, T. 1999. The pagerank citation ranking: Bringing order to the web. Tech. rep. 1999-66, Stanford InfoLab. http://ilpubs.stanford.edu:8090/422/.Google Scholar
- Raggett, D., Le Hors, A., and Jacobs, I. 1999. HTML 4.01 specification, section ‘autolayout algorithm’. http://www.w3.org/TR/html4/appendix/notes.html#h-B.5.2.Google Scholar
- Vanoirbeek, C. 1992. Formatting structured tables. In Proceedings of Electronic Publishing (EP92). Cambridge University Press, 291--309.Google Scholar
- Wang, X. and Wood, D. 1997. Tabular formatting problems. In Proceedings of the 3rd International Workshop on Principles of Document Processing (PODP’96). Springer, 171--181. Google Scholar
Digital Library
Index Terms
HTML Automatic Table Layout
Recommendations
Optimal automatic table layout
DocEng '11: Proceedings of the 11th ACM symposium on Document engineeringAutomatic layout of tables is useful in word processing applications and is required in on-line applications because of the need to tailor the layout to the viewport width, choice of font and dynamic content. However, if the table contains text, ...
Solving the simple continuous table layout problem
DocEng '06: Proceedings of the 2006 ACM symposium on Document engineeringAutomatic table layout is required in web applications. Unfortunately, this is NP-hard for reasonable layout requirements such as minimizing table height for a given width. One approach is to solve a continuous relaxation of the layout problem in which ...
Automatic Minimal-Height Table Layout
Automatic layout of tables is useful in word processing applications and is required in online applications because of the need to tailor the layout to viewport width, choice of font, and dynamic content. However, if the table contains text, minimizing ...






Comments