Quote:
|
Continuing to play with this ...
I'm finding that style.width and offsetWidth are not the same. That is mostly explained here: https://stackoverflow.com/questions/...twidth-in-html This is probably why the author of https://codereview.stackexchange.com...igning-columns uses a Property Value: Code:
// get inner width because thats what we will set Code:
var tmp = window.getComputedStyle(thElements[0], null); Code:
width: 100px Furthermore, I'm unfamiliar with the `${tmp.toString()}` construct. I've googled for examples and explanations, but no luck so far. What does it do? |
OK, I figured it out. The .getPropertyValue should be bolted onto the preceeding getComputedStyle() function. Don't know why it doesn't show that way in the link. Also, the `${tmp.toString()}` construct is a bit over-complicated. tmp.toString() will do. Still, if anyone can tell me what that whole `${ ... }` syntax is supposed to do, I'd appreciate it.
My final javascript function is below and that works just fine. I've already used it on a customer website. No need to mess with CSS at all; no <thead> or <tbody> needed: Code:
/* Adust table columns for use in scrolling long reports Code:
<body onload="adjustCols('tblHeader', 'tblData', 0)"> |
Quote:
Just wondering...what happens if the visitor is using a javascript blocker? |
Quote:
http://www.htmlhelp.com/feature/art2.htm http://www.htmlhelp.com/feature/art2a.htm http://www.htmlhelp.com/feature/art2b.htm http://www.htmlhelp.com/feature/art2c.htm Although he focused on non-standard markup, and the post pre-dates the spread of javascript, the same arguments also apply to relying on javascript for functionality. The WWW is a real puzzle. It's the only part of marketing and sales where people expend extra effort to go out of their way to shrink their potential. By sticking with HTML + CSS for the base, one guarantees the largest potential reach. By designing to a specific subset of technology, that potential reach is reduced. Then, from the security perspective, there are many exploit chains that start out with getting JS into the browser and end with full root access. Some even reach down into x86-based speculative execution flaws in the CPU to gain root. mfoley, I'd encourage you to try the CSS list again and get a response one way or another about it being possible or impossible to use clean CSS + HTML for the task, and save JS as a fallback. |
All times are GMT -5. The time now is 05:40 PM. |