td widths, not working?

It should be: or Note that if your cell contains some content that doesn’t fit into the 200px (like somelongwordwithoutanyspaces), the cell will stretch nevertheless, unless your CSS contains table-layout: fixed for the table. EDIT As kristina childs noted on her answer, you should avoid both the width attribute and using inline CSS (with the … Read more

Colspan all columns

I have IE 7.0, Firefox 3.0 and Chrome 1.0 The colspan=”0″ attribute in a TD is NOT spanning across all TDs in any of the above browsers. Maybe not recommended as proper markup practice, but if you give a higher colspan value than the total possible no. of columns in other rows, then the TD … Read more

Form inside a table

A form is not allowed to be a child element of a table, tbody or tr. Attempting to put one there will tend to cause the browser to move the form to it appears after the table (while leaving its contents — table rows, table cells, inputs, etc — behind). You can have an entire … Read more

Table fixed header and scrollable body

Fixed table head – CSS-only Simply position: sticky; top: 0; your th elements. (Chrome, FF, Edge) For both sticky vertical TH and horizontal TH columns (inside TBODY): TH borders problem fix Since border cannot be painted properly on a translated TH element, to recreate and render “borders” use the box-shadow property: Fixed table head – using JS. (IE) You can use a bit of JS and translateY the th elements jQuery example Or plain … Read more

Set cellpadding and cellspacing in CSS?

Basics For controlling “cellpadding” in CSS, you can simply use padding on table cells. E.g. for 10px of “cellpadding”: For “cellspacing”, you can apply the border-spacing CSS property to your table. E.g. for 10px of “cellspacing”: This property will even allow separate horizontal and vertical spacing, something you couldn’t do with old-school “cellspacing”. Issues in … Read more