This example shows both the left and right columns being fixed in place. This example shows the first column being set to width: 200px (note that this is not pixel perfect in a table, the browser will make some adjustments! The style attribute specifies an inline style for an element. The ideal thing to do is to scroll the body of the table while leaving the headings fixed. Cell padding specifies the space between the cell content and its borders. fixed: With this value, the tables layout ignores the content and instead uses the tables width, any specified width of columns, and border and cell spacing values. HTML Table - Add Cell Padding. It is very uncomfortable to scroll horizontally to see the table rows. For that, youll need to use some CSS. 3. Top and Left positions have to be negative (Top = -height of header row, Left = -width of header column) so that the headers are no more visible than the body div. That includes ignoring any column sizes set and making them as small as possible! 13 comments Comments. Obviously By copying the whole table, all rows and columns will have equal width As the result whole HTML table has wrong columns widths. The first uses fixed The resulting table layout is generally dependent on the content of the table. But, fix the width of the table first. Without fixed column widths, the table will dynamically resize the columns depending on the width of the data that is displayed. When all column widths are explicitly set and the cumulative column width is greater than the available Grid width, a horizontal scrollbar appears and all set column widths are respected. The container will have as many columns as can fit without any of them having a width less than the column-width value. The width can either be defined as an absolute number (e.g. It will override any style set in the HTML