In the realm of web development, there is a well-known mantra: "Only use tables for tabular data." This advice stems from a time when tables were misused for all sorts of layout purposes.
While I generally adhere to this guideline, there are moments when certain layout challenges demand the use of a table - tasks that blur the line between "tabular data" and other types of data. The situation at hand embodies one such scenario.
This scenario is quite traditional in nature:
Name: […]
Surname: […]
Age: […]
Job: […]
The placeholders [...] represent textboxes. Is this considered tabular data? Should I utilize a table to organize these labels and textboxes, or should I opt for a combination of <div>
s and <span>
s? Using a table would facilitate proper vertical alignment and aid in aligning labels of varying widths. But would it be deemed "correct", or merely another personal preference?
Now, consider viewing it like this:
Field | Value
---------------
Name: […]
Surname: […]
Age: […]
Job: […]