Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE offsetWidthfloat calculation #168

Merged
merged 1 commit into from
Mar 9, 2015
Merged

IE offsetWidthfloat calculation #168

merged 1 commit into from
Mar 9, 2015

Conversation

mhwlng
Copy link
Contributor

@mhwlng mhwlng commented Mar 7, 2015

in IE, offsetWidth returns an integer, but table cell width returns a
float, this causes cell text to be split over two lines

see #167

in IE, offsetWidth returns an integer, but table cell width returns a
float, this causes cell text to be split over two lines
@mkoryak
Copy link
Owner

mkoryak commented Mar 7, 2015

Thanks, since this only affects ie 9, can you check for it and only do this workaround if it is being used. you can check for it with if(ieVersion == 9)

also, since we don't need the height part of this code, can you get rid of it please?

Otherwise, this looks good. Thanks for the PR, I've not had much time this week and this is a huge help.

@mhwlng
Copy link
Contributor Author

mhwlng commented Mar 7, 2015

no, this is a problem for every IE version (including IE11) and firefox.
Please use the code as you see fit. I am not planning any more pull requests...

@mkoryak
Copy link
Owner

mkoryak commented Mar 7, 2015

ok, sounds good thanks. Before you take off, can you suggest how to build a test-case for this so that I can see it fix the problem?

@mhwlng
Copy link
Contributor Author

mhwlng commented Mar 7, 2015

The example below results in the second column header being split over two lines (IE any version,firefox)
without the offsetWidth modification.
(Chrome is ok)

untitled

(only when useAbsolutePositioning: false)

<html>
<head>
<script src="jquery-2.1.3.min.js"></script>
<script src="jquery.floatThead._.js"></script>
<script src="jquery.floatThead.js"></script>
<script>
  $(function () {
    $('.isis-table').floatThead({
      useAbsolutePositioning: false
    });
  });
</script>
</head>
<body>
<table class="isis-table">
<thead>
<tr>
<td>Reason</td>
<td>Time (h:m:s)</td>
<td>Time(%)</td>
</tr>
</thead>
<tbody>
<tr>
<td>SE manual stop</td>
<td>11:28:43</td>
<td>30.9</td>
</tr>
</tbody>
</table>
</body>
</html>

mkoryak added a commit that referenced this pull request Mar 9, 2015
IE offsetWidthfloat calculation
@mkoryak mkoryak merged commit bd6e084 into mkoryak:master Mar 9, 2015
@mkoryak
Copy link
Owner

mkoryak commented Mar 9, 2015

this fix makes the testcase look worse:
screen shot 2015-03-09 at 5 22 07 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants