1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00
DataTables/.datatables-commit-sync
Allan Jardine 6fbd3ba8e6 New: Add the ability to read size information from HTML elements for columns
- Column width is always a particularly difficult one to get quite
  right. In this case, the fix is to have DataTables read column width
  information from the `width` or `style` attributes of a column header
  cell, if that information is present. If it is, it is treated as
  sWidth is (although user supplied sWidth can override). That is it say
  that it will be applied to the column width calculation table.

- The remaining gap is if a developer assigns a width using css classes.
  We can't get that information, so we fall into the old problem.

- This change comes about from the discussion in
  http://datatables.net/forums/discussion/19089 and the fiddle here:
  http://jsfiddle.net/EysLd/1/

- What is happening in the test case is that the calculation table is
  being created, but it is then stripped of widths due to this commit:
  https://github.com/DataTables/DataTables/commit/6a9e324 . That was to
  allow DataTables column headers to have their applied size removed, so
  a new size could be calculated. Only sWidth would override that - now
  the width and style attributes will as well
2014-01-15 16:19:03 +00:00

2 lines
41 B
Plaintext

41dc47b2d50e3bf87e4266365c24257c64a5e3ae