Forum Moderators: open

Message Too Old, No Replies

Dynamic value for colspan and rowspan.

A tip very useful for script templates.

         

JAB Creations

3:39 pm on Jan 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Of late I've been working on script templates (such as vBulletin) which the quality of the XHTML is severely less then desirable. After fixing up two templates which both shared a child template I noticed that the colspan would only work for one or the other. I needed a dynamic value which would automatically span any given number of columns. A little research on the W3C revealed the following...

W3C HTML 4.0 Section 11.2.6
[w3.org...]

This attribute specifies the number of columns spanned by the current cell. The default value of this attribute is one ("1"). The value zero ("0") means that the cell spans all columns from the current column to the last column of the column group (COLGROUP) in which the cell is defined.

Setting the colspan or rowspan attributes to have a value of "0" will automatically span any given number of columns or rows.

Hope this saves some headaches out there. :)

John

BlobFisk

3:58 pm on Jan 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An excellent find - thanks John!