Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Table rendering algorithms, recommended reading?

Tags:

html

algorithm

I was wondering how modern browsers render html tables, for example how they figure out the exact size of the cells. After googling a bit, all I found was an RFC from 1996, but nothing new. Since I also read that html 5 specifies the parsing algorithm, so I thought maybe the algorithm for determinating the layout is also specified or at least it is described how a possible algorithm should work. Just looking at the code of open source browsers would probably be very time consuming and therefore rather not an option.

like image 218
Nils Avatar asked Feb 17 '12 10:02

Nils


People also ask

How do you create a table with 3 columns and 3 rows in HTML?

Creating Tables in HTMLYou can create a table using the <table> element. Inside the <table> element, you can use the <tr> elements to create rows, and to create columns inside a row you can use the <td> elements. You can also define a cell as a header for a group of table cells using the <th> element.

How do I make a table with different sized cells in HTML?

To manipulate the height or width of an entire table, place the size attribute (either "WIDTH=" or "HEIGHT=") within the <TABLE> code. To manipulate individual cells, place the size attribute within the code for that cell.


1 Answers

Not specific to HTML, but the paper The Table Layout Problem (Richard J. Anderson, Sumeet Sobti) analyzes laying out a table, e.g. minimum height for fixed width and other problems.

It concludes that the problem is NP-complete and suggests a number of heuristics.

like image 200
Adrian Leonhard Avatar answered Oct 05 '22 20:10

Adrian Leonhard