<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[HTML] How do I make a &lt;table&gt; with scrollbars?</title>
		<link>http://www.allegro.cc/forums/view/594857</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 10 Feb 2008 21:55:29 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I can&#39;t seem to come up with a way to make a table with a vertical scroll bar so that I can scroll up and down in the table without scrolling up and down in the window. Ideally , I&#39;d like the table header , caption and row headers be fixed in place. If it&#39;s possible , I&#39;d like to do it without javascript. Any one know how to do this?</p><p>I&#39;m also having trouble getting the table to be a predefined width and height.<br />I tried it like this :<br /> </p><pre>
&lt;table width=100px; height=100px&gt;
</pre><p>
but that just resizes the cells in the table. What am I doing wrong?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 22 Jan 2008 11:23:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Put the table in a div that has a style of <tt>overflow: auto;</tt> and a height.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Tue, 22 Jan 2008 11:40:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t think its really possible.  The next best thing is to make a separate table for the header and use Ryans trick for the inner/scrolling table.</p><p>Hm.. on second thought... maybe try this?
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k3">&lt;</span>style&gt;</td></tr><tr><td class="number">2</td><td>colgroup.scroller <span class="k2">{</span></td></tr><tr><td class="number">3</td><td>    overflow: <span class="k1">auto</span><span class="k2">;</span></td></tr><tr><td class="number">4</td><td><span class="k2">}</span></td></tr><tr><td class="number">5</td><td><span class="k3">&lt;</span><span class="k3">/</span>style&gt;</td></tr><tr><td class="number">6</td><td>&#160;</td></tr><tr><td class="number">7</td><td><span class="k3">&lt;</span>table&gt;</td></tr><tr><td class="number">8</td><td> <span class="k3">&lt;</span>tr&gt;</td></tr><tr><td class="number">9</td><td>  <span class="k3">&lt;</span>th&gt;Header Blah<span class="k3">&lt;</span><span class="k3">/</span>th&gt;</td></tr><tr><td class="number">10</td><td>  <span class="k3">&lt;</span>th&gt;Header Blah<span class="k3">&lt;</span><span class="k3">/</span>th&gt;</td></tr><tr><td class="number">11</td><td> <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;</td></tr><tr><td class="number">12</td><td> <span class="k3">&lt;</span>colgroup span<span class="k3">=</span><span class="s">"2"</span> <span class="k1">class</span><span class="k3">=</span><span class="s">"scroller"</span><span class="k3">&gt;</span><span class="k3">&lt;</span><span class="k3">/</span>colgroup&gt;</td></tr><tr><td class="number">13</td><td> <span class="k3">&lt;</span>tr&gt;</td></tr><tr><td class="number">14</td><td>  <span class="k3">&lt;</span>td&gt;Data<span class="k3">&lt;</span><span class="k3">/</span>td&gt;</td></tr><tr><td class="number">15</td><td>  <span class="k3">&lt;</span>td&gt;Data<span class="k3">&lt;</span><span class="k3">/</span>td&gt;</td></tr><tr><td class="number">16</td><td> <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;</td></tr><tr><td class="number">17</td><td><span class="k3">&lt;</span><span class="k3">/</span>table&gt;</td></tr></tbody></table></div></div><p>

You have to manually enter the number of columns in &#39;span&#39;.  0 is supposed to mean &#39;all columns&#39; but apparently support for it is flimsy.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dustin Dettmer)</author>
		<pubDate>Tue, 22 Jan 2008 11:54:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>One browser (Firefox?) supports scrollable tables via:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k3">&lt;</span>table&gt;
  <span class="k3">&lt;</span>thead&gt;<span class="k3">&lt;</span>tr&gt; ... <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;<span class="k3">&lt;</span><span class="k3">/</span>thead&gt;
  <span class="k3">&lt;</span>tbody style<span class="k3">=</span><span class="s">"max-height: 400px; overflow: auto;"</span><span class="k3">&gt;</span>
    <span class="k3">&lt;</span>tr&gt; ... <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tbody&gt;
<span class="k3">&lt;</span>table&gt;
</pre></div></div><p>
That would be the sensible way to support it, but you won&#39;t find any other browsers that do it. </p><p>You&#39;re best off making a JS function that splits tables into two. It&#39;s not very hard.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 22 Jan 2008 12:12:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t know if this solution is any good, or if it works in IE. I use linux, so it&#39;s not so easy to check. But here is how I would solve the problem.</p><p><a href="http://www.timorg.net/scroll.html">http://www.timorg.net/scroll.html</a></p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k3">&lt;</span>TABLE CELLPADDING<span class="k3">=</span><span class="n">0</span> CELLSPACING<span class="k3">=</span><span class="n">0</span><span class="k3">&gt;</span></td></tr><tr><td class="number">2</td><td><span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD&gt;</td></tr><tr><td class="number">3</td><td>    <span class="k3">&lt;</span>TABLE BORDER<span class="k3">=</span><span class="n">1</span> CELLSPACING<span class="k3">=</span><span class="n">0</span><span class="k3">&gt;</span></td></tr><tr><td class="number">4</td><td>        <span class="k3">&lt;</span>TR&gt;</td></tr><tr><td class="number">5</td><td>            <span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>Colomn <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>Colomn <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>Colomn <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>Colomn <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>TD&gt;</td></tr><tr><td class="number">6</td><td>        <span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">7</td><td>    <span class="k3">&lt;</span><span class="k3">/</span>TABLE&gt;</td></tr><tr><td class="number">8</td><td><span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">9</td><td><span class="k3">&lt;</span>TR HEIGHT<span class="k3">=</span><span class="n">100</span><span class="k3">&gt;</span><span class="k3">&lt;</span>TD&gt;</td></tr><tr><td class="number">10</td><td>    <span class="k3">&lt;</span>DIV style<span class="k3">=</span><span class="s">"overflow-y:scroll; width: 100%; height: 100"</span><span class="k3">&gt;</span></td></tr><tr><td class="number">11</td><td>        <span class="k3">&lt;</span>TABLE BORDER<span class="k3">=</span><span class="n">1</span> CELLSPACING<span class="k3">=</span><span class="n">0</span><span class="k3">&gt;</span></td></tr><tr><td class="number">12</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-one<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-one<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-one<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-one<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">13</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-two<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-two<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-three<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-four<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">14</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-three<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-three<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-three<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-three<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">15</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-four<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-four<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-four<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-four<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">16</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-five<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-five<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-five<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-five<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">17</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-six<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-six<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-six<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-six<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">18</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-seven<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-seven<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-seven<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-seven<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">19</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-eight<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-eight<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-eight<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-eight<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">20</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-nine<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-nine<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-nine<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-nine<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">21</td><td>            <span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>one-ten<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>two-ten<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>three-ten<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span>TD WIDTH<span class="k3">=</span><span class="n">150</span><span class="k3">&gt;</span>four-ten<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">22</td><td>        <span class="k3">&lt;</span><span class="k3">/</span>TABLE&gt;</td></tr><tr><td class="number">23</td><td>    <span class="k3">&lt;</span><span class="k3">/</span>DIV&gt;</td></tr><tr><td class="number">24</td><td><span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;</td></tr><tr><td class="number">25</td><td><span class="k3">&lt;</span><span class="k3">/</span>TABLE&gt;</td></tr></tbody></table></div></div><p>

-Tim
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Timorg)</author>
		<pubDate>Tue, 22 Jan 2008 12:21:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>- CGamesPlay -<br />I put this in :<br /> </p><pre>
&lt;div style=&quot;overflow: auto; height=50px; width=100px&quot;&gt;(Table stuff)&lt;/div&gt;
</pre><p>
but it doesn&#39;t resize the table , and there are no scroll bars.</p><p>I found <a href="http://www.htmlbasix.com/scrollingtable.shtml">this site</a> , which generates the code for you and it comes up with the same thing , enclose the table in div tags and use overflow: auto; for the div style as well , but that&#39;s not working.</p><p> </p><pre>
&lt;div style=&quot;overflow: scroll; height=50px; width=100px&quot;&gt;
</pre><p>
I changed it to overflow: scroll; and scroll bars appeared with no scroller , and the table still doesn&#39;t resize. When I resize the window , the table cells start to wrap , but I don&#39;t want that. How do I fix the table cells at their minimum width so that they don&#39;t wrap and scroll bars appear?</p><p>I found <a href="http://www.cssplay.co.uk/menu/tablescroll.html">this web page</a> , which has two scrolling tables , and it looks like it uses overflow:auto in the div tags too.</p><p>- Dustin -<br />Okay , I added in that style section and put in the colgroup tags like you said. It works somewhat as long as I keep the table in a div tag with a style of overflow: scroll; , however , even if I put the colgroup tag after the th table headers , it scrolls the entire table.</p><p>- Matthew -<br />I tried out </p><pre>&lt;tbody style=&quot;overflow: auto; max-height=100px&quot;&gt;</pre><p> and that doesn&#39;t work to bring up scroll bars. If I change it to overflow: scroll; , scroll bars come up but only a horizontal scroller when it doesn&#39;t need to be scrolled , and no vertical scroller when there&#39;s not enough space for all the rows. What did you mean by using javascript to split the table in two? I&#39;ve never even used javascript before. Would it read the table and make one table with the headers and another table with the rest of the rows or what?</p><p>- Timorg -<br />Your html works for me in both SeaMonkey and IE7 , although it&#39;s a little strange to have to put two </p><pre>&lt;tr&gt;&lt;td&gt;&lt;table&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&#39;s</pre><p> inside another table just to get it to scroll properly. I do have one problem with it though , and that&#39;s that I want the table headers and the table rows to have the same width columns. I guess since I will know the number of columns ahead of time I can just add in a width=##% for each of the &lt;td&gt; tags , but I&#39;d like them to remain a fixed size just large enough so that no lines wrap.</p><p>I still haven&#39;t figured out how to specify a fixed size for the table.<br /> </p><pre>&lt;table border=1; max-height=100px; max-width=100px&gt;</pre><p>
doesn&#39;t work for some reason , and neither does putting the max width and height in the div tag.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 22 Jan 2008 13:34:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Half of the code you just wrote is incorrect.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 22 Jan 2008 14:04:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[Stop mentally chanting html noob , and be specific about what&#39;s wrong and what isn&#39;t please. I only started learning html a few days ago.<br />
<br />
Right now , I&#39;m currently working off of Timorg&#39;s html code and it works to get the non table header rows to scroll , but the columns of the header row and the columns of the table rows don&#39;t match up for column widths.<br />
Here&#39;s what I have :<br />
<a href="http://www.allegro.cc/files/attachment/594302">sandbox3tablescroll.html</a><br />
<pre class="source-code"><span class="k3">&lt;</span><span class="k3">!</span>DOCTYPE HTML PUBLIC <span class="s">"-//W3C/DTD XHTML 1.0 Transitional//EN"</span> <span class="s">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>html xlmns<span class="k3">=</span><span class="s">"http://www.w3.org/1999/xhtml"</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>head&gt;

<span class="k3">&lt;</span>title&gt;Welcome to Sandbox #<span class="n">3</span> , scrolling? tables <span class="k3">!</span><span class="k3">&lt;</span><span class="k3">/</span>title&gt;
<span class="k3">&lt;</span>meta name<span class="k3">=</span><span class="s">"keywords"</span> content<span class="k3">=</span><span class="s">"sandbox, practice, lookheresearchengine"</span> <span class="k3">/</span><span class="k3">&gt;</span>

<span class="k3">&lt;</span>style&gt;
colgroup.scroller <span class="k2">{</span>
    overflow: scroller<span class="k2">;</span>
<span class="k2">}</span>
tbody tr td <span class="k2">{</span><span class="k2">}</span>
<span class="k3">&lt;</span><span class="k3">/</span>style&gt;

<span class="k3">&lt;</span>p&gt;Scrolling tables , <span class="k1">or</span> are there?<span class="k3">&lt;</span><span class="k3">/</span>p&gt;
<span class="k3">&lt;</span><span class="k3">/</span>head&gt;

<span class="k3">&lt;</span>body <span class="k3">&gt;</span>


<span class="k3">&lt;</span>table border<span class="k3">=</span><span class="n">2</span><span class="k2">;</span><span class="k3">&gt;</span>

  <span class="k3">&lt;</span>tr&gt;
    <span class="k3">&lt;</span>td&gt;

      <span class="k3">&lt;</span>table border<span class="k3">=</span><span class="n">1</span><span class="k2">;</span><span class="k3">&gt;</span>
        <span class="k3">&lt;</span>tbody&gt;
          <span class="k3">&lt;</span>tr&gt;
            <span class="k3">&lt;</span>td&gt;Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span>td&gt;Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span>td&gt;Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span>td&gt;Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span>td&gt;Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tbody&gt;
      <span class="k3">&lt;</span><span class="k3">/</span>table&gt;

    <span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;

  <span class="k3">&lt;</span>tr&gt;
    <span class="k3">&lt;</span>td&gt;
             
      <span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> style<span class="k3">=</span><span class="s">"max-height: 100px; overflow-y: scroll;"</span><span class="k3">&gt;</span>
        <span class="k3">&lt;</span>table border<span class="k3">=</span><span class="n">1</span><span class="k3">&gt;</span>
          <span class="k3">&lt;</span>tbody&gt;
            <span class="k3">&lt;</span>tr&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">2</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;R2C2<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">2</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">2</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">2</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
            <span class="k3">&lt;</span>tr&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
            <span class="k3">&lt;</span>tr&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
            <span class="k3">&lt;</span>tr&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
            <span class="k3">&lt;</span>tr&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
            <span class="k3">&lt;</span>tr&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
              <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
            <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
          <span class="k3">&lt;</span><span class="k3">/</span>tbody&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>table&gt;
      <span class="k3">&lt;</span><span class="k3">/</span>div&gt;
                 
    <span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
<span class="k3">&lt;</span><span class="k3">/</span>table&gt;


<span class="k3">&lt;</span><span class="k3">/</span>body&gt;


<span class="k3">&lt;</span><span class="k3">/</span>html&gt;</pre>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 22 Jan 2008 14:26:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The issue with the header not lining up with the body is to do with you haven&#39;t set the width of the cells.</p><p>I set the widths for all the cells, so that they would all be the same, so that the lined up, where in your example you have allowed them to use them to automatically size to fit the content, and you get the results you see.</p><p>As for having the headings and the div in a table, it keeps them aligned together and in a block, I possibly could have used a &lt;div&gt; to keep them together. But I am table addicted, I use them for everything.</p><p>You are getting inline CSS styles with HTML. HTML has...
</p><pre>
&lt;TABLE WIDTH=100 HEIGHT=200&gt;
</pre><p>

The parameters are in the form, name, and then an equals sign, then the value.</p><p>Where CSS goes into a style tag, and uses a &#39;:&#39; instead of the equals sign, and the parameters are separated by a &#39;;&#39;. 
</p><pre>
&lt;TABLE WIDTH=100 HEIGHT=200 STYLE=&quot;name: value; name: another_value;&quot;&gt;
</pre><p>

But you probably already know that as you have your &lt;STYLE&gt; tags done right.</p><p>-Tim
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Timorg)</author>
		<pubDate>Tue, 22 Jan 2008 15:11:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for the clarification. The table now resizes properly for me.</p><p>Since I&#39;m using your method , with two tables as the table data of 2 different table rows for the outer table , why doesn&#39;t it adjust the width of both rows (containing the two tables) to be the same though? If it was just a single table with two rows having different length text then the row widths would be adjusted to fit the longer data right? </p><p>I don&#39;t know how wide I need to make the rows , since this table is being built by a homemade C++ html file writer I am making. Maybe I could try and precalculate the maximum width by finding the longest string that will go into a cell but then how do I translate the number of characters into a pixel size? Does a 12pt font render 12 pixels wide?</p><p>Is there a way to force horizontal scrolling when the table isn&#39;t wide enough to prevent cell text wrapping?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 22 Jan 2008 16:10:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[If both tables were 100% wide, the scrollbar takes up room, so the bottom table would be skinnier.<br />
<br />
The outer table is only has two cells, one stacked on top of each other, the top table and bottom table are separate from each other, so they don&#39;t know how wide each others cells are. The same problem occurs with horizontal scrolling, the top table cells content (the table) has no idea of where the &lt;DIV&gt; has scrolled to.<br />
<br />
I guess you could use javascript, get the values and apply them to the other parts of the text box, but that would be complicated, and I have no idea to go about that, and it might be very unresponsive.<br />
<br />
As for calculating the width of a field of the cell widths, you could use a true type library, setup the font the page will use, and measure it. But fonts take up different amounts of pixel space depending on the screen resolution. A 10pt font on 1280x1024 takes up more pixel space than on a 1024x768 screen, so you will need a lib that can specify pixels as font size, and they need to interpret the pixels for font size in the same way as the browser, then to make it more painful, different browsers might interpret the heights differently.<br />
<br />
on <a href="http://en.wikipedia.org/wiki/Point_(typography)">http://en.wikipedia.org/wiki/Point_(typography)</a><br />
Scroll down to &quot;Current DTP point system&quot; to find more about the &#39;pt&#39; system.<br />
<br />
Also how large a &#39;pt&#39; sized font is also dependent on the pixels per inch of the display. I think you can ignore it for this problem, cause I don&#39;t know if windowing systems (windows or linux based ones) bothers knowing about screen size. I hope someone can verify this.<br />
<br />
Edit:<br />
<br />
In firefox at least, you can only read the width of an object if you have set it, if you get the value and it isn&#39;t set, you get an empty string.<br />
<br />
eg.<br />
<a href="http://www.timorg.net/check_size.html">http://www.timorg.net/check_size.html</a><br />
<br />
<pre class="snippet"><span class="k3">&lt;</span>HTML&gt;
<span class="k3">&lt;</span>BODY&gt;
<span class="k3">&lt;</span>TABLE BORDER<span class="k3">=</span><span class="n">1</span> WIDTH<span class="k3">=</span><span class="n">800</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>TR&gt;<span class="k3">&lt;</span>TD NAME<span class="k3">=</span><span class="s">'blah'</span><span class="k3">&gt;</span>Hello<span class="k3">&lt;</span><span class="k3">/</span>TD&gt;<span class="k3">&lt;</span><span class="k3">/</span>TR&gt;
<span class="k3">&lt;</span><span class="k3">/</span>TABLE&gt;
<span class="k3">&lt;</span>SCRIPT&gt;
<a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span>document.getElementsByName<span class="k2">(</span><span class="s">'blah'</span><span class="k2">)</span><span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.width<span class="k2">)</span><span class="k2">;</span>
<span class="k3">&lt;</span><span class="k3">/</span>SCRIPT&gt;
<span class="k3">&lt;</span><span class="k3">/</span>BODY&gt;
<span class="k3">&lt;</span><span class="k3">/</span>HTML&gt;</pre>]]>
		</description>
		<author>no-reply@allegro.cc (Timorg)</author>
		<pubDate>Tue, 22 Jan 2008 16:43:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay , found an easier way.<br /> </p><pre>
&lt;style&gt;
td {width: (maxchar*14);font-size: 14px;}
&lt;/style&gt;
</pre><p>

&#39;maxchar*14&#39; will be replaced by the actual number when the html file gets written.</p><p>However , I still can&#39;t manage to make the table cells stop wrapping text when the table isn&#39;t wide enough. Is there a min-width property? Will that force the table to make a horizontal scrollbar if there is not enough room for the table? I don&#39;t mind if the window has to scroll , but I don&#39;t want the text to wrap. It looks bad and makes it harder to read.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 22 Jan 2008 17:21:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you use <span class="source-code"><span class="k3">&amp;</span>nbsp<span class="k2">;</span></span> instead of a space character, the text wont be broken onto a new line.</p><p><span class="source-code"><span class="s">'&amp;nbsp;'</span> stands <span class="k1">for</span> Non Breaking Space.</span></p><p>As for multiplying the number of characters by the px size, probably doesn&#39;t give you the width of the string, I am pretty sure the px is the height not the width of a character. But if you pick a high enough value for the character width, it will probably have the result you want.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Timorg)</author>
		<pubDate>Tue, 22 Jan 2008 17:29:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I do not know much about HTML, but what about using frames? Would not this force the table to be scrollable?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jacob Dawid)</author>
		<pubDate>Tue, 22 Jan 2008 17:42:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I used <span class="source-code"><span class="k3">&amp;</span>nbsp<span class="k2">;</span></span> and it works wonderfully. Now when I set the width and height of the outer table , when it&#39;s too small a horizontal scroll bar appears. Nice!</p><p>Is there a way to set a text property so that in certain elements , all spaces are interpreted as non-breaking spaces without having to parse them in as such?</p><p>I don&#39;t know much about frames. I&#39;ll take a look at using one tomorrow , thanks for the suggestion Jacob.</p><p>Does anyone have any ideas how I can get the vertical scroll bar set outside the visible columns of the table so that the header columns and the row columns line up? I still have to set the &lt;td&gt; width to an approximate value so that the columns will line up nicely between the two rows of the outer table. After I figure that out should I try to set the width of the two inner tables or should I try to set the width of the two outer rows where the second one is wider by 20 pixels or so?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 22 Jan 2008 18:10:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You should be using JavaScript like I originally suggested. All the other solutions have drawbacks. Sometimes you can live with them, but usually not.</p><p>Regarding your incorrect HTML, you didn&#39;t even copy/paste the examples correctly. So if you want to see what you are doing wrong, you should compare your snippets with the ones other people have provided. The biggest problem is that you are mixing HTML and CSS syntax up.</p><div class="source-code snippet"><div class="inner"><pre><span class="k3">&lt;</span>table width<span class="k3">=</span><span class="s">"500"</span> style<span class="k3">=</span><span class="s">"width: 500px;"</span><span class="k3">&gt;</span>
</pre></div></div><p>

The HTML width has no units. It&#39;s just a number (or a percentage). CSS uses colon and semicolon separated values.</p><p>And the accepted style of modern day HTML is to lower case everything, to use quotes around all attributes, and to close all tags.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 22 Jan 2008 23:33:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Td elements have a nowrap attribute IIRC.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fladimir da Gorf)</author>
		<pubDate>Wed, 23 Jan 2008 00:44:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[I don&#39;t know any javascript. Know any links to well-written tutorials/references?<br />
Timorg helped correct me on my usage errors , and I&#39;m cleaning them up. I&#39;m sticking to writing style rules in the head section for the different tags for now. Thanks for the grammar tips. I retried the tips that you and Dustin provided but both failed according to the explanation I gave before. The method I&#39;m using now encloses a normal table in two sets of div tags.<br />
<br />
I still haven&#39;t been able to reliably set the width of a th or td cell.<br />
<br />
I tried using a different approach , using method #1 from <a href="http://www.cssplay.co.uk/menu/tablescroll.html">CSS Play - CSS scrolling tables</a><span class="url"> [cssplay.co.uk]</span> , and even though I copied the styles explicitly and used the same attributes for the different table tags , I can&#39;t get the columns of the header and the rows to synchronize widths without using position:relative; in the .outerdiv thead tr style definition but then the scroll bar moves the headers up and down as well as the tbody rows. I can&#39;t seem to get a strict cell width set for &lt;td&gt; and &lt;th&gt; tags. It adjusts the cell widths somewhat , but not to a fixed width.<br />
<br />
Here&#39;s the html code I am using right now :<br />
<a href="http://www.allegro.cc/files/attachment/594306">sandbox6tablescroll-cssplayA.html</a><br />
<pre class="source-code"><span class="k3">&lt;</span><span class="k3">!</span>DOCTYPE HTML PUBLIC <span class="s">"-//W3C/DTD XHTML 1.0 Transitional//EN"</span> <span class="s">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>html xlmns<span class="k3">=</span><span class="s">"http://www.w3.org/1999/xhtml"</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>head&gt;

<span class="k3">&lt;</span>title&gt;Welcome to Sandbox #<span class="n">6</span> , tables scrolling yet? <span class="k3">!</span><span class="k3">&lt;</span><span class="k3">/</span>title&gt;
<span class="k3">&lt;</span>meta name<span class="k3">=</span><span class="s">"keywords"</span> content<span class="k3">=</span><span class="s">"sandbox, practice, lookheresearchengine"</span> <span class="k3">/</span><span class="k3">&gt;</span>


<span class="k3">&lt;</span>style&gt;
.outerdiv <span class="k2">{</span>
  position:relative<span class="k2">;</span>
  padding:4em <span class="n">0</span> <span class="n">3e</span>m <span class="n">0</span><span class="k2">;</span>
  width:54em<span class="k2">;</span>
  background:#eee<span class="k2">;</span>
  margin:0 <span class="k1">auto</span> <span class="n">3e</span>m <span class="k1">auto</span><span class="k2">;</span>
<span class="k2">}</span>
.innerdiv <span class="k2">{</span>
  overflow:auto<span class="k2">;</span>
  width:54em<span class="k2">;</span>
  height:5em<span class="k2">;</span>
  background:#eee<span class="k2">;</span>
<span class="k2">}</span>
.outerdiv table caption <span class="k2">{</span>
  position:absolute<span class="k2">;</span>
  width:51.7em<span class="k2">;</span>
  text-align:center<span class="k2">;</span>
  top:0<span class="k2">;</span>
  left:0<span class="k2">;</span>
  height:1.5em<span class="k2">;</span>
  background:#<span class="n">697210</span><span class="k2">;</span>
  border:0.1em solid #fff<span class="k2">;</span>
  color:#fff<span class="k2">;</span>
<span class="k2">}</span>
.outerdiv thead tr <span class="k2">{</span>
  position:absolute<span class="k2">;</span>
  top:1.5em<span class="k2">;</span>
  height:1.5em<span class="k2">;</span>
  left:0<span class="k2">;</span>
<span class="k2">}</span>
.outerdiv tfoot td <span class="k2">{</span>
  position:absolute<span class="k2">;</span>
  width:51.5em<span class="k2">;</span>
  text-align:center<span class="k2">;</span>
  background:#f0c992<span class="k2">;</span> 
  border:0.1em solid #<span class="n">000</span><span class="k2">;</span>
  color:#<span class="n">000</span><span class="k2">;</span>
  bottom:0<span class="k2">;</span>
  left:0
<span class="k2">}</span>
.outerdiv th , outerdiv td <span class="k2">{</span>
  width:10em<span class="k2">;</span> 
  text-align:left<span class="k2">;</span>
<span class="k2">}</span>
.outerdiv th <span class="k2">{</span>
  background:#<span class="n">724a10</span><span class="k2">;</span> 
  color:#fff<span class="k2">;</span><span class="k2">}</span>
  .outer .dk <span class="k2">{</span>background:#fff<span class="k2">;</span>
<span class="k2">}</span>

<span class="k3">&lt;</span><span class="k3">/</span>style&gt;

<span class="k3">&lt;</span>p&gt;Scrolling tables , <span class="k1">or</span> are there?<span class="k3">&lt;</span><span class="k3">/</span>p&gt;
<span class="k3">&lt;</span>hr style<span class="k3">=</span><span class="s">"width:100%; height:10px; color:green; background-color:green;"</span><span class="k3">/</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span><span class="k3">/</span>head&gt;

<span class="k3">&lt;</span>body <span class="k3">&gt;</span>

<span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k1">class</span><span class="k3">=</span><span class="s">"outerdiv"</span><span class="k3">&gt;</span>
  <span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k1">class</span><span class="k3">=</span><span class="s">"innerdiv"</span><span class="k3">&gt;</span>
    <span class="k3">&lt;</span>table summary<span class="k3">=</span><span class="s">"Trying to make the table look nice , work with me here"</span><span class="k3">&gt;</span>
                     
      <span class="k3">&lt;</span>caption&gt;Sample table to test scroll abilities<span class="k3">&lt;</span><span class="k3">/</span>caption&gt;
                  
      <span class="k3">&lt;</span>thead&gt;
        <span class="k3">&lt;</span>tr&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"col"</span><span class="k3">&gt;</span>Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"col"</span><span class="k3">&gt;</span>Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"col"</span><span class="k3">&gt;</span>Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"col"</span><span class="k3">&gt;</span>Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"col"</span><span class="k3">&gt;</span>Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
      <span class="k3">&lt;</span><span class="k3">/</span>thead&gt;
                
      <span class="k3">&lt;</span>tfoot&gt;
        <span class="k3">&lt;</span>tr&gt;
          <span class="k3">&lt;</span>td colspan<span class="k3">=</span><span class="s">"5"</span><span class="k3">&gt;</span>Are the scroll bars working?<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
      <span class="k3">&lt;</span><span class="k3">/</span>tfoot&gt;
                   
      <span class="k3">&lt;</span>tbody&gt;
        <span class="k3">&lt;</span>tr <span class="k1">class</span><span class="k3">=</span><span class="s">"dk"</span><span class="k3">&gt;</span>
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"row"</span><span class="k3">&gt;</span>Row <span class="n">2</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>td&gt;R2C2<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">2</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">2</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">2</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
        <span class="k3">&lt;</span>tr&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"row"</span><span class="k3">&gt;</span>Row <span class="n">3</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row<span class="s">''</span><span class="n">3</span><span class="s">''</span>Column<span class="s">''</span><span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">3</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
        <span class="k3">&lt;</span>tr <span class="k1">class</span><span class="k3">=</span><span class="s">"dk"</span><span class="k3">&gt;</span>
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"row"</span><span class="k3">&gt;</span>Row <span class="n">4</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">4</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
        <span class="k3">&lt;</span>tr&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"row"</span><span class="k3">&gt;</span>Row <span class="n">5</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">5</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
        <span class="k3">&lt;</span>tr <span class="k1">class</span><span class="k3">=</span><span class="s">"dk"</span><span class="k3">&gt;</span>
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"row"</span><span class="k3">&gt;</span>Row <span class="n">6</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">6</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
        <span class="k3">&lt;</span>tr&gt;
          <span class="k3">&lt;</span>th scope<span class="k3">=</span><span class="s">"row"</span><span class="k3">&gt;</span>Row <span class="n">7</span> Column <span class="n">1</span><span class="k3">&lt;</span><span class="k3">/</span>th&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">2</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">3</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">4</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
          <span class="k3">&lt;</span>td&gt;Row <span class="n">7</span> Column <span class="n">5</span><span class="k3">&lt;</span><span class="k3">/</span>td&gt;
        <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
                    
      <span class="k3">&lt;</span><span class="k3">/</span>tbody&gt;
                  
    <span class="k3">&lt;</span><span class="k3">/</span>table&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>div&gt;
<span class="k3">&lt;</span><span class="k3">/</span>div&gt;

<span class="k3">&lt;</span><span class="k3">/</span>body&gt;


<span class="k3">&lt;</span><span class="k3">/</span>html&gt;</pre>Even if I adjust the width in the <br />
 <pre>.outerdiv th , .outerdiv td {
  width:10em;
  text-align:left;
}</pre>section , it doesn&#39;t adjust all the cell widths to the same amounts.<br />
<br />
Well , I just tried this last version in IE7 and it renders everything with the column widths adjusted to the same amount for all the rows. It doesn&#39;t render them exactly according to the width suggested , but it does a lot better than Mozilla&#39;s doing right now. How&#39;s FireFox look? I don&#39;t have it on this machine yet.<br />
<br />
Do you see any errors in the html I&#39;m using? I can&#39;t see any styles or attributes that I left out for any of the tags that I used. I checked over the two css files linked to in the source for the CSSplay scroller page and nothing there would affect any of the tags in what I used as far as I know. I don&#39;t understand why the CSSplay scrolling tables page renders both tables perfectly but it won&#39;t render this one right when I&#39;m using the exact same style rules and data structure?<br />
<br />
Any other suggestions?<br />
<br />
- Fladimir -<br />
How would I use the no wrap attribute? Would it work for th tags as well?<br />
 <pre>&lt;style&gt;
td {wrap:none; word-wrap;no ; ??:??;}
&lt;/style&gt;</pre>- Append -<br />
I tried altering the dtd to match what the website was using , but it didn&#39;t fix or change anything. I was using XHTML 1.0 Transitional and the web page was using Strict. No change though.<br />
<br />
- Append 2 -<br />
I noticed that if all of the table row&#39;s first column tags are &lt;td&gt; and not &lt;th&gt; that then their widths don&#39;t match up with the first thead column. As soon as one is changed to use the &lt;th&gt; tag then it adjust the width of the cells in that column to match the header (or itself maybe). What attribute does the &lt;th&gt; tag have that the &lt;td&gt; one doesn&#39;t? The only difference in style attributes is that the &lt;th&gt; tag has some color attributes associated with it. Why would that matter? Is it just some intrinsic property of the &lt;th&gt; tag?]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 23 Jan 2008 01:01:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I went ahead and uploaded an idea I had.  Apparently its only IE5+ but it seems ideal.</p><p><a href="http://dustytech.com/examples/scrollytable.php">http://dustytech.com/examples/scrollytable.php</a></p><p>I can&#39;t get rid of the horizontal scroll-bar on FF.  The page is wiki-editable so if someone else has a solution please update it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dustin Dettmer)</author>
		<pubDate>Wed, 23 Jan 2008 02:28:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In HTML: &lt;td nowrap&gt;&lt;/td&gt;<br />In XHTML: &lt;td nowrap=&quot;nowrap&quot;&gt;&lt;/td&gt;</p><p>Though I&#39;m not sure if it&#39;s in strict XHTML.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fladimir da Gorf)</author>
		<pubDate>Wed, 23 Jan 2008 02:38:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I went ahead and uploaded an idea I had. Apparently its only IE5+ but it seems ideal.
</p></div></div><p>
It looks like the same thing <a href="http://www.allegro.cc/forums/thread/594857/722879#target">I suggested</a>... But I don&#39;t think anything except Firefox supports that. I know IE7 doesn&#39;t.</p><p>And even on Firefox, the scrollbars are inside the table (which is reasonable) but the headers don&#39;t know that (which is unreasonable) so you get horizontal scrollbars.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 23 Jan 2008 03:16:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>- Fladimir -<br />Nice , I added in the nowrap:nowrap; attribute , and now all the table row columns are lining up well. However , size changes still don&#39;t seem to affect the &lt;thead&gt;&lt;tr&gt;&lt;th&gt; column titles to the same degree as the &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; cells.<br /> </p><pre>
.outerdiv th , .outerdiv td {
  nowrap:nowrap;
  width:250px; 
  text-align:left;
}
</pre><p>
I also fixed a missing . dot class prefix before the outerdiv td in there.<br />Tweaking outerdiv , innerdiv , caption , and footer widths makes it nicer , but I still don&#39;t know how to make the column widths be a fixed non-negotiable value.</p><p>Other than that html code is same as before and now produces this (using XHTML 1.0 Transitional) :<br /> <a href="http://www.allegro.cc/files/attachment/594315">sandbox6tablescroll-cssplayA.html</a><br /> <span class="remote-thumbnail"><span class="json">{"name":"594314","src":"http:\/\/static.allegro.cc\/image\/cache\/6\/2\/6248a699e023a49faff4f4e76496a97e.jpg","w":867,"h":472,"tn":"http:\/\/static.allegro.cc\/image\/cache\/6\/2\/6248a699e023a49faff4f4e76496a97e"}</span><img src="http://static.allegro.cc/image/cache/6/2/6248a699e023a49faff4f4e76496a97e-240.jpg" alt="594314" width="240" height="130" /></span></p><p>So it only looks nice when the column widths for &lt;th&gt; and &lt;td&gt; are tweaked along with making the outer and inner div style attributes wide enough for all the columns. If there&#39;s not enough room in the div for all the columns then they get smushed together regardless of having the nowrap:nowrap; attribute for cells set.</p><p>Something else strange is that when I make the &lt;thead&gt;&lt;tr&gt; tags use position:relative; instead of absolute that then the header row moves inside the inner div out of the outer div. After that the column widths auto adjust but then the headers and table rows scroll together though.</p><p>- Dustin -<br />Looking pretty good on the wiki , I copied out the code and made an html file out of it and it&#39;s working pretty well on SeaMonkey. It&#39;s sure a lot nicer looking than  a bunch of &lt;div&gt; wrappers and massive styling code. I must have had too much extra junk in my html file when I tried you and Matthew&#39;s solutions last time. I took out the style attributes in the &lt;tbody&gt; tag and tried out the &lt;colgroup span=&quot;2&quot; class=&quot;scroller&quot;&gt;&lt;/colgroup&gt; again but I couldn&#39;t get any variation of colgroup to implement a scroller. I can&#39;t seem to get rid of the horizontal scroll bar on the wiki code either.</p><p>Yeah , IE7 doesn&#39;t like the wiki version. It makes it all huge with no scrollbars.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 23 Jan 2008 04:26:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Seamonkey is the ugliest piece of <span class="cuss"><span><span class="cuss"><span>shit</span></span></span></span> ever. Looks too much like Netscape.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Wed, 23 Jan 2008 09:44:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[And Firefox is soooo special.<br />
I&#39;ll ignore the SeaMonkey comment as now I don&#39;t have to add this onto the end of my last post. - Edit - Besides , that was the classic look for Mozilla , I just hadn&#39;t set my theme to Modern yet. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" border="0" /><br />
Modern theme screenpic below.<br />
<br />
<br />
I googled around and I found a better solution for preventing line wrapping in data cells. Use &lt;nobr&gt;&lt;/nobr&gt; tags around the div or table. As long as it has the overflow attribute set to auto or scroll the cells will stay in the boundaries of the table and scroll bars will appear. I also found this style attribute , but haven&#39;t tested it : style=&quot;white-space:nowrap;&quot;. I haven&#39;t found a solution to the problem of including the headers and rows in the same div or table without making the header row get scrolled as well. The best solution I&#39;ve found so far is to set the width&#39;s of the &lt;thead&gt;&lt;tr&gt; tag to the same width as the &lt;tbody&gt; - 1em for the scrollbar. Even then , if you don&#39;t set the width of the header row to the combined width of the table row&#39;s cells then you get a horizontal scrollbar and it goes out of sync with the headers. This shouldn&#39;t be so complicated.<br />
<br />
<div class="quote_container"><div class="title">Quote:</div><div class="quote">Put the table in a div that has a style of overflow: auto; and a height.</div></div>Check.<div class="quote_container"><div class="title">Quote:</div><div class="quote">The next best thing is to make a separate table for the header and use Ryans trick for the inner/scrolling table.</div></div>Check.<div class="quote_container"><div class="title">Quote:</div><div class="quote">You&#39;re best off making a JS function that splits tables into two. It&#39;s not very hard.</div></div>Off to learn Javascript.<br />
<br />
Basically I started over with a fresh table , split it into two tables , one for the headers and one for the rows of the table body , with each table in its own div and a div wrapper for it all to make the background look a little better. Used &lt;nobr&gt; tags around the two tables and overflow:auto; in the div for the table body. Manually adjusting the widths of the components is obnoxious though and that&#39;s where the javascript should finish the job by setting the appropriate widths of the header row , and the div for the table body. It looks good in SeaMonkey and in IE7 the table rows aren&#39;t quite as wide for some reason but looks decent anyway.<br />
<br />
Here&#39;s the latest incarnation of the scroll table :<br />
 <a href="http://www.allegro.cc/files/attachment/594318">NobrDivScrollTable.html</a><br />
<pre class="source-code"><span class="k3">&lt;</span><span class="k3">!</span>DOCTYPE HTML PUBLIC <span class="s">"-//W3C/DTD XHTML 1.0 Transitional//EN"</span> <span class="s">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>html xlmns<span class="k3">=</span><span class="s">"http://www.w3.org/1999/xhtml"</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>head&gt;

<span class="k3">&lt;</span>title&gt;Nobr Div Scroll Table <span class="k3">-</span> Welcome to Sandbox #<span class="n">2</span> <span class="k3">!</span><span class="k3">&lt;</span><span class="k3">/</span>title&gt;
<span class="k3">&lt;</span>meta name<span class="k3">=</span><span class="s">"keywords"</span> content<span class="k3">=</span><span class="s">"sandbox, practice, lookheresearchengine"</span> <span class="k3">/</span><span class="k3">&gt;</span>

<span class="k3">&lt;</span>style&gt;
.theaderdiv <span class="k2">{</span>
  position:relative<span class="k2">;</span>
  width:41.7em<span class="k2">;</span>
  border:3px solid cyan<span class="k2">;</span>
  background:#eee<span class="k2">;</span>
  height<span class="k3">=</span><span class="n">1</span>.<span class="n">5e</span>m<span class="k2">;</span>
  margin:2em <span class="n">2e</span>m <span class="k1">auto</span> <span class="n">2e</span>m<span class="k2">;</span>
<span class="k2">}</span>
.tbodydiv <span class="k2">{</span>
  position:relative<span class="k2">;</span>
  overflow:auto<span class="k2">;</span>
  width:42.7em<span class="k2">;</span>
  border:3px solid cyan<span class="k2">;</span>
  background:#eee<span class="k2">;</span>
  height:10em<span class="k2">;</span>
  margin:auto <span class="n">2e</span>m <span class="n">2e</span>m <span class="n">2e</span>m<span class="k2">;</span>
<span class="k2">}</span>
.tbackgrounddiv <span class="k2">{</span>
  position:relative<span class="k2">;</span>
  width:47em<span class="k2">;</span>
  background:#<span class="n">990099</span><span class="k2">;</span>
  border:5px #<span class="n">663399</span> solid<span class="k2">;</span>
<span class="k2">}</span>
thead <span class="k2">{</span>
<span class="k2">}</span>
tbody <span class="k2">{</span>
<span class="k2">}</span>
.centered <span class="k2">{</span>
  text-align:center<span class="k2">;</span>
<span class="k2">}</span>
th , td <span class="k2">{</span>
  border:1px black solid<span class="k2">;</span>
  width:30em<span class="k2">;</span>
<span class="k2">}</span>
<span class="k3">&lt;</span><span class="k3">/</span>style&gt;

<span class="k3">&lt;</span>p&gt;Making scrolling tables <span class="k1">using</span> nobr , <a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> , <span class="k1">and</span> overflow<span class="k3">&lt;</span><span class="k3">/</span>p&gt;
<span class="k3">&lt;</span><span class="k3">/</span>head&gt;

<span class="k3">&lt;</span>nobr&gt;

<span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k1">class</span><span class="k3">=</span><span class="s">"tbackgrounddiv"</span><span class="k3">&gt;</span>

<span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k1">class</span><span class="k3">=</span><span class="s">"theaderdiv"</span><span class="k3">&gt;</span>
<span class="k3">&lt;</span>table style<span class="k3">=</span><span class="s">"cellpadding:4; cellspacing:4; border:1 solid black;"</span><span class="k3">&gt;</span>
 <span class="k3">&lt;</span>thead&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>th&gt;Header Blah<span class="k3">&lt;</span><span class="k3">/</span>th&gt;
   <span class="k3">&lt;</span>th&gt;Header Blah<span class="k3">&lt;</span><span class="k3">/</span>th&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
 <span class="k3">&lt;</span><span class="k3">/</span>thead&gt;
<span class="k3">&lt;</span><span class="k3">/</span>table&gt;
<span class="k3">&lt;</span><span class="k3">/</span>div&gt;

<span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k1">class</span><span class="k3">=</span><span class="s">"tbodydiv"</span><span class="k3">&gt;</span>

<span class="k3">&lt;</span>table style<span class="k3">=</span><span class="s">"cellpadding:4; cellspacing:4; border:1 solid black; width:40em;"</span><span class="k3">&gt;</span>
 <span class="k3">&lt;</span>tbody&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;Data Data Data Data Data Data Data Data Data Data<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;Data<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>Data Data Data Data Data Data Data Data Data Data<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;Data<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
  <span class="k3">&lt;</span>tr&gt;
   <span class="k3">&lt;</span>td&gt;Data<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
   <span class="k3">&lt;</span>td <span class="k1">class</span><span class="k3">=</span><span class="s">"centered"</span><span class="k3">&gt;</span>DataDataDataDataDataDataDataDataDataData<span class="k3">&lt;</span><span class="k3">/</span>td&gt;
  <span class="k3">&lt;</span><span class="k3">/</span>tr&gt;
 <span class="k3">&lt;</span><span class="k3">/</span>tbody&gt;
<span class="k3">&lt;</span><span class="k3">/</span>table&gt;

<span class="k3">&lt;</span><span class="k3">/</span>div&gt;

<span class="k3">&lt;</span><span class="k3">/</span>div&gt;

<span class="k3">&lt;</span><span class="k3">/</span>nobr&gt;

<span class="k3">&lt;</span><span class="k3">/</span>body&gt;


<span class="k3">&lt;</span><span class="k3">/</span>html&gt;</pre>And a nice little picture of the table in SeaMonkey for BAF.<br />
 <span class="remote-thumbnail"><span>jpg;820;519;160;101</span><img src="http://static.allegro.cc/image/cache/e58e1fe4be98fee6d75a0fc6c4af5d07.thumb.jpg" alt="" width="160" height="101" /></span><br />
<br />
Anyone care to give me a brief introduction how to interface javascript functions with html objects?]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 23 Jan 2008 10:14:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s a little better, but I still hate seamonkey. I tried it out and went back to FF.</p><p>And I&#39;ve been running FF3b2 exclusively since I installed Vista. More memory bugs fixed, their new garbage collector works quite well. Plus it doesn&#39;t slowly degrade until having to be restarted. I&#39;ve had it open with quite a few tabs for... at least a week and it&#39;s locked pretty much at 265MB (doesn&#39;t go up or down much unless I open/close tabs).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Wed, 23 Jan 2008 12:09:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
It&#39;s a little better, but I still hate seamonkey. I tried it out and went back to FF.
</p></div></div><p>Stop derailing the thread.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Off to learn Javascript.
</p></div></div><p>Great! While you&#39;re at it, look at HTML, too. You have a &lt;p&gt; element in your &lt;head&gt; element, you don&#39;t provide a type attribute on your &lt;style&gt; element, you&#39;re using a &lt;meta&gt; keywords (which everyone knows <a href="http://www.allegro.cc/forums/thread/594865">search engines don&#39;t use</a>), and you don&#39;t have a &lt;body&gt; element.</p><p>Instead of &lt;nobr&gt;, you can use CSS, as well.</p><p>As far as the actual table is concerned: I&#39;d add an extra table header cell the size of the scroll bar, to keep the table a box.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Wed, 23 Jan 2008 21:04:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>- CGamesPlay -<br />Like I said earlier , I only started learning html a few days ago.<br />The &lt;p&gt; element in the html header section was a leftover from a test page I was using. If a &lt;p&gt; element is illegal in the header then why would the browser render it any way? That&#39;s like my compiler letting me use a function I haven&#39;t defined. It shouldn&#39;t be rendered in quirks mode due to the !DOCTYPE declaration , so I blame it on the browser. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> I won&#39;t use it that way anymore. As far as not providing a type attribute on the &lt;style&gt; element , what do you mean? Please provide an example.</p><p>So are there really no search engines that use meta keywords anymore , or is it just Google that doesn&#39;t use them now?</p><p>As for not using a &lt;body&gt; element , that&#39;s due to cut-paste coding and poor oversight. If I had started a new page over , I would have put it in.</p><p> </p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Instead of &lt;nobr&gt;, you can use CSS, as well.
</p></div></div><p>
What CSS would I use though?<br />I haven&#39;t tried this yet :<br /> </p><pre>
&lt;style&gt;
table {
  whitespace:no-wrap;
}
&lt;/style&gt;
</pre><p>

What I&#39;m really interested in now is figuring out how to set different element widths using javascript. Should I use an onload attribute to call a javascript function? How do I get different objects properties and use them in a function?</p><p>Remember , I&#39;m just a beginner at all this , so be patient and specific please.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 24 Jan 2008 07:11:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&lt;style type=&quot;text/css&gt;<br />&lt;/style&gt;</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
What I&#39;m really interested in now is figuring out how to set different element widths using javascript. Should I use an onload attribute to call a javascript function? How do I get different objects properties and use them in a function?
</p></div></div><p>
You could use an onload to call a function that scans the HTML for all tables with a certain class (say splitTable) and then does its magic.</p><p>foo.getElementsByTagName(&quot;TD&quot;) and foo.childNodes are your friends.</p><p>foo can be something like &#39;document&#39; or any element.</p><p>foo.offsetWidth will give you the width of an element. Note that CSS is a bit unfriendly and you&#39;ll have to subtract the padding and border from it.<br /> <br /><tt>tdHeader.width = tdBody.offsetWidth - (border + padding)</tt>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Thu, 24 Jan 2008 07:24:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This javascript resizing is not going nicely.</p><p>So far I&#39;ve been trying to use something like this :
</p><div class="source-code snippet"><div class="inner"><pre><span class="k3">&lt;</span>script type<span class="k3">=</span><span class="s">"text/javascript"</span><span class="k3">&gt;</span>
function AlterWidth<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span>
  var tableheaderdiv <span class="k3">=</span> document.getElementById<span class="k2">(</span><span class="s">"tableheaderdiv_id"</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span>tableheaderdiv.width<span class="k2">)</span><span class="k2">;</span>
  tableheaderdiv.width <span class="k3">=</span> <span class="n">400</span>px<span class="k2">;</span>
  var tableheaderdiv_a <span class="k3">=</span> document.getElementById<span class="k2">(</span><span class="s">"tableheaderdiv_id"</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span>tableheaderdiv_a.width<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
<span class="k3">&lt;</span><span class="k3">/</span>script&gt;

<span class="c">// table stuff</span>

<span class="k3">&lt;</span>button onclick<span class="k3">=</span>AlterWidth<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span><span class="k3">&gt;</span>Alter Table Header Div Width<span class="k3">&lt;</span><span class="k3">/</span>button&gt;
</pre></div></div><p>

I&#39;ve also tried that to adjust the table &lt;head&gt; width which does nothing in SeaMonkey , but works in IE7.</p><p>In both cases , the first alert shows up blank or says &quot;undefined&quot;.<br />The second alert shows whatever width I set it to though , whether it rendered on the page or not.</p><p>The best javascript reference guide I&#39;ve found so far is <a href="http://www.w3schools.com/jsref/default.asp">w3schools Javascript Reference</a> but it doesn&#39;t have a listing of properties for the &lt;div&gt; tag on its <a href="http://www.w3schools.com/htmldom/dom_reference.asp">HTML DOM reference</a>. I looked at the <a href="http://www.w3schools.com/htmldom/dom_obj_table.asp">properties for a table</a> and it doesn&#39;t even have a height property! Sometimes I wonder just who was in charge of defining a table in HTML anyway. I&#39;ll have to do some specialized javascript testing tomorrow for &lt;div&gt; , &lt;table&gt; , &lt;head&gt; , and &lt;body&gt; to see what I can really adjust or not.</p><p>Any suggestions?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 24 Jan 2008 19:06:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Like I said earlier , I only started learning html a few days ago.
</p></div></div><p>No, I didn&#39;t mean that with any degree of sarcasm. I was just letting you know what you needed to work on <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If a &lt;p&gt; element is illegal in the header then why would the browser render it any way? That&#39;s like my compiler letting me use a function I haven&#39;t defined. It shouldn&#39;t be rendered in quirks mode due to the !DOCTYPE declaration , so I blame it on the browser. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div></div><p>If you want, you can rename the file to .xml, and make it well-formed XHTML. The browser (Firefox has this feature, at least), will error if you have any semantic problems.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
tableheaderdiv.width = 400px;
</p></div></div><p>That&#39;s not valid Javascript any more than it&#39;s valid C++ <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> You need to put it in a string. For example, these work:</p><div class="source-code snippet"><div class="inner"><pre>width <span class="k3">=</span> <span class="s">"400px"</span><span class="k2">;</span>
width <span class="k3">=</span> <span class="n">400</span> <span class="k3">+</span> <span class="s">"px"</span><span class="k2">;</span>
</pre></div></div><p>

</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
&lt;button onclick=AlterWidth();&gt;Alter Table Header Div Width&lt;/button&gt;
</p></div></div><p>That&#39;s not valid XML. You need attribute quotes.<br /><span class="source-code"><span class="k3">&lt;</span>button onclick<span class="k3">=</span><span class="s">"AlterWidth();"</span><span class="k3">&gt;</span>Alter Table Header Div Width<span class="k3">&lt;</span><span class="k3">/</span>button&gt;</span></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Any suggestions?
</p></div></div><p>Get Firebug. Using the HTML tab, select an element. In the right pane, select DOM. It lists all the methods and properties for the given node.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Thu, 24 Jan 2008 21:01:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><tt>/derail</tt>
</p><div class="quote_container"><div class="title">CGamesPlay said:</div><div class="quote"><p>
That&#39;s not valid Javascript any more than it&#39;s valid C++ <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> You need to put it in a string. For example, these work:
</p><div class="source-code snippet"><div class="inner"><pre>width <span class="k3">=</span> <span class="s">"400px"</span><span class="k2">;</span>
width <span class="k3">=</span> <span class="n">400</span> <span class="k3">+</span> <span class="s">"px"</span><span class="k2">;</span>
</pre></div></div><p>
</p></div></div><p>
IMO, they should just use a single unit of measure and give you conversion functions. I know I would prefer it. I still think of strings as messy.
</p><div class="source-code snippet"><div class="inner"><pre>width <span class="k3">=</span> <span class="n">400</span><span class="k2">;</span> <span class="c">// 400px</span>
width <span class="k3">=</span> percentToPixels<span class="k2">(</span><span class="n">50</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// 50%.</span>
width <span class="k3">=</span> emToPixels<span class="k2">(</span><span class="n">16</span>, fontFamily<span class="k2">)</span><span class="k2">;</span> <span class="c">// 16em</span>
</pre></div></div><p>
I think it might make positioning things easier as well if everything had a defined width, height, and position in pixels... Stupid Web languages... <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Thu, 24 Jan 2008 21:26:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Then use prototype, or Ext&hellip;
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Thu, 24 Jan 2008 22:01:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">CGamesPlay said:</div><div class="quote"><p>
Then use prototype, or Ext…
</p></div></div><p>
If I ever get around to doing some Web development at home I probably will, but since I know little or nothing about those right now it&#39;s not an option to just start using them at work where I do most of my Web development...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Thu, 24 Jan 2008 22:21:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I thought so too. Then I tried out Ext, and when I converted my application to it, I had half the code size <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Thu, 24 Jan 2008 22:48:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">CGamesPlay said:</div><div class="quote"><p>
I thought so too. Then I tried out Ext, and when I converted my application to it, I had half the code size <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div></div><p>
The problem is integrating it into the existing system. I&#39;m also not sure about the licensing issues... <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> It&#39;s another LGPL project (the same as that drag &#39;n drop library I found a while ago), though there are commercial and OEM licensing options... I would definitely like to use it though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Thu, 24 Jan 2008 23:48:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>[TINLA] As far as licensing goes, Ext is LGPL, meaning you can use Ext in an application and doing so does not make it LGPL itself. Additionally, if you modify Ext itself, you only have to distribute the sources to the changes you make <i>if you distribute the application</i>. In the web world, source and application are often equivalent anyways, so LGPL is even less binding.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 25 Jan 2008 04:39:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>- CGamesPlay -<br />Thanks for the continuing grammar and usage corrections. Let&#39;s see if I&#39;ve got style usage down now.<br /> </p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k3">&lt;</span><span class="k3">!</span><span class="k3">-</span><span class="k3">-</span>Using an external style sheet--&gt;</td></tr><tr><td class="number">2</td><td><span class="k3">&lt;</span>head&gt;</td></tr><tr><td class="number">3</td><td>  <span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_531.html" target="_blank">link</a> rel<span class="k3">=</span><span class="s">"stylesheet"</span> type<span class="k3">=</span><span class="s">"text/css"</span> href<span class="k3">=</span><span class="s">"externalstyle.css"</span> <span class="k3">/</span><span class="k3">&gt;</span></td></tr><tr><td class="number">4</td><td><span class="k3">&lt;</span><span class="k3">/</span>head&gt;</td></tr><tr><td class="number">5</td><td><span class="k3">&lt;</span><span class="k3">!</span><span class="k3">-</span><span class="k3">-</span>externalstyle.css--&gt;</td></tr><tr><td class="number">6</td><td>tagname <span class="k2">{</span>attribute:value<span class="k2">;</span> attribute:value<span class="k2">;</span><span class="k2">}</span></td></tr><tr><td class="number">7</td><td>&#160;</td></tr><tr><td class="number">8</td><td><span class="k3">&lt;</span><span class="k3">!</span><span class="k3">-</span><span class="k3">-</span>Using an <span class="k1">inline</span> style sheet--&gt;</td></tr><tr><td class="number">9</td><td><span class="k3">&lt;</span>head&gt;</td></tr><tr><td class="number">10</td><td><span class="k3">&lt;</span>style type<span class="k3">=</span><span class="s">"text/css"</span><span class="k3">&gt;</span></td></tr><tr><td class="number">11</td><td>  tagname <span class="k2">{</span></td></tr><tr><td class="number">12</td><td>    attribute:value<span class="k2">;</span></td></tr><tr><td class="number">13</td><td>    attribute:value<span class="k2">;</span></td></tr><tr><td class="number">14</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">15</td><td><span class="k3">&lt;</span><span class="k3">/</span>style&gt;</td></tr><tr><td class="number">16</td><td><span class="k3">&lt;</span><span class="k3">/</span>head&gt;</td></tr><tr><td class="number">17</td><td>&#160;</td></tr><tr><td class="number">18</td><td><span class="k3">&lt;</span><span class="k3">!</span><span class="k3">-</span><span class="k3">-</span>Using <span class="k1">inline</span> styles in tags--&gt;</td></tr><tr><td class="number">19</td><td><span class="k3">&lt;</span>tagname style<span class="k3">=</span><span class="s">"attribute:value; attribute:value;"</span><span class="k3">&gt;</span><span class="k3">&lt;</span><span class="k3">/</span>tagname&gt;</td></tr></tbody></table></div></div><p>

And for plain html attributes :
</p><div class="source-code snippet"><div class="inner"><pre><span class="k3">&lt;</span>tagname attribute<span class="k3">=</span><span class="s">"value"</span> attribute<span class="k3">=</span><span class="s">"value"</span><span class="k3">&gt;</span><span class="k3">&lt;</span><span class="k3">/</span>tagname&gt;
</pre></div></div><p>

I did all but the first from memory. I think those are right.</p><p>Okay , now I have a question about defining classes. How do I properly define a subclass using &lt;style&gt; tags?<br />I tried it like this :<br /> </p><pre>
&lt;style type=&quot;text/css&quot;&gt;
.baseclass1 {
  attribute:name;
  .b1subclass1 {
    attribute:name;
  }
}
&lt;/style&gt;
</pre><p>
but b1subclass1 doesn&#39;t get recognized. I&#39;d like to use some form of inheritance so that I can just use </p><pre>&lt;tagname class=&quot;b1subclass1&quot;&gt;&lt;/tagname&gt;</pre><p>
Can an element have more than one class? If they can , the second one should override the first right?</p><p>Another question , what&#39;s the best way for mousedrag resizing? Add an extra element for a grab bar and recalculate the inner element&#39;s width based on the grab bar&#39;s position?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 25 Jan 2008 11:38:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="k3">&lt;</span>tagname <span class="k1">class</span><span class="k3">=</span><span class="s">"class1 class2 class3"</span><span class="k3">&gt;</span><span class="k3">&lt;</span><span class="k3">/</span>tagname&gt;
</pre></div></div><p>
Now tagname above has 3 classes associated with it.  I have no clue on what order or precedence it gets.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dustin Dettmer)</author>
		<pubDate>Fri, 25 Jan 2008 12:20:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I have no clue on what order or precedence it gets.
</p></div></div><p>
If I remember correctly, it goes based on the order the class is defined in the CSS. The order inside the attribute is irrelevant.</p><p>So if you do this:
</p><div class="source-code snippet"><div class="inner"><pre>.classname1
<span class="k2">{</span>
<span class="k2">}</span>
.classname2
<span class="k2">{</span>
<span class="k2">}</span>
</pre></div></div><p>

Then <tt>&lt;div class=&quot;classname1 classname2&quot;&gt;</tt> and <tt>&lt;div class=&quot;classname2 classname1&quot;&gt;</tt> are identical with classname2 always overriding the classname1 since it comes after in the CSS file.</p><p>You can also do this:</p><div class="source-code snippet"><div class="inner"><pre>.classname1.classname2
<span class="k2">{</span>
<span class="k2">}</span>
</pre></div></div><p>
And that would only apply if both are present at the same time.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 25 Jan 2008 13:54:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I think those are right.
</p></div></div><p>Yes, they all are <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If I remember correctly, it goes based on the order the class is defined in the CSS.
</p></div></div><p>The <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order">rules for cascading</a> are complex. First and foremost, a rule with <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#important-rules">!important</a> always overrides other rules. Then, the rule that is more <i>specific</i> wins, and finally the rule that appears last in the file wins, if all else is a tie. To find out how specific a rule is, it&#39;s mostly intuitive. However, a technical explanation is available <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#specificity">here</a>.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
&lt;div class=&quot;classname1 classname2&quot;&gt; and &lt;div class=&quot;classname2 classname1&quot;&gt; are identical with classname2 always overriding the classname1 since it comes after in the CSS file.
</p></div></div><p>These two are always identical, regardless of the above rules. If you want the second one to override the first, you have to either be more specific in the rule, or put it after the first.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Another question , what&#39;s the best way for mousedrag resizing? Add an extra element for a grab bar and recalculate the inner element&#39;s width based on the grab bar&#39;s position?
</p></div></div><p>Yeah, mainly. You may want to look into Ext, as it will greatly simplify your work load.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 25 Jan 2008 19:27:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Edgar Reynaldo said:</div><div class="quote"><p>
Okay , now I have a question about defining classes. How do I properly define a subclass using &lt;style&gt; tags?<br />I tried it like this :</p><p>&lt;style type=&quot;text/css&quot;&gt;<br />.baseclass1 {<br />  attribute:name;<br />  .b1subclass1 {<br />    attribute:name;<br />  }<br />}<br />&lt;/style&gt;</p><p>but b1subclass1 doesn&#39;t get recognized. I&#39;d like to use some form of inheritance so that I can just use</p><p>&lt;tagname class=&quot;b1subclass1&quot;&gt;&lt;/tagname&gt;
</p></div></div><p>
AFAIK, there is no such thing as sub-classes in css. Unfortunately, you&#39;re forced to define a whole new class. <i>AFAIK</i>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 25 Jan 2008 23:30:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
AFAIK, there is no such thing as sub-classes in css. Unfortunately, you&#39;re forced to define a whole new class. AFAIK.
</p></div></div><p>You know correctly. However, as has been stated:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k3">&lt;</span>style type<span class="k3">=</span><span class="s">"text/css"</span><span class="k3">&gt;</span></td></tr><tr><td class="number">2</td><td>.message <span class="k2">{</span></td></tr><tr><td class="number">3</td><td>    background: #eee<span class="k2">;</span></td></tr><tr><td class="number">4</td><td>    border: solid <span class="n">1</span>px #<span class="n">666</span><span class="k2">;</span></td></tr><tr><td class="number">5</td><td><span class="k2">}</span></td></tr><tr><td class="number">6</td><td>&#160;</td></tr><tr><td class="number">7</td><td><span class="c">/* This rule will only affect elements with both classes. Note that</span></td></tr><tr><td class="number">8</td><td><span class="c">there is no space between the class names. Adding a space has a</span></td></tr><tr><td class="number">9</td><td><span class="c">different meaning. */</span></td></tr><tr><td class="number">10</td><td>.message.error <span class="k2">{</span></td></tr><tr><td class="number">11</td><td>    background: #fee<span class="k2">;</span></td></tr><tr><td class="number">12</td><td>    color: red<span class="k2">;</span></td></tr><tr><td class="number">13</td><td>    font-weight: bold<span class="k2">;</span></td></tr><tr><td class="number">14</td><td><span class="k2">}</span></td></tr><tr><td class="number">15</td><td><span class="k3">&lt;</span><span class="k3">/</span>style&gt;</td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td><span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k1">class</span><span class="k3">=</span><span class="s">"message"</span><span class="k3">&gt;</span>This is a message.<span class="k3">&lt;</span><span class="k3">/</span>div&gt;</td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td><span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k1">class</span><span class="k3">=</span><span class="s">"message error"</span><span class="k3">&gt;</span>This is an error.<span class="k3">&lt;</span><span class="k3">/</span>div&gt;</td></tr></tbody></table></div></div><p>The first message will appear in a gray box with a dark gray border. The second message will appear in a pink (#fee) box with a dark gray border, and with red text. Notice how the second one had all the properties of the first, but some were overridden, and new ones were added.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Sat, 26 Jan 2008 00:17:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here&#39;s my work in progress javascript and html for converting a normal table contained inside a div into two &lt;div&gt;&lt;table&gt;&#39;s with the second being scrollable and containing the &lt;tbody&gt; data from the original table.</p><p>I&#39;m having trouble with it though , perhaps the way I&#39;m working with strings is incorrect , however , I used the same method earlier in the script and it works fine.</p><p>For some reason , there is an exception thrown at the line where I first try to assign the var newtablehtml a value using string addition. It&#39;s near the bottom of the SplitTable() function.<br />&lt;code&gt;<br />&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C/DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt;<br />&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot;&gt;</p><p>&lt;head&gt;</p><p>  &lt;title&gt;Java Script Table Adjustment&lt;/title&gt;<br />  <br />  &lt;script type=&quot;text/javascript&quot;&gt;<br />    function SplitTable () {<br />      var table1div=document.getElementById(&quot;table1&quot;);<br />      var starttable=table1div.getElementsByTagName(&quot;table&quot;);<br />      var tabletheadstring = &quot;cellspacing=\&quot;0\&quot; class=\&quot;theadtable\&quot;&quot;;<br />      var tabletbodystring = &quot;cellspacing=\&quot;0\&quot; class=\&quot;tbodytable\&quot;&quot;;<br />      var max_cell_width = 0;<br />      for (var i = 0 ; i &lt; 1 ; i++ ) {<br />        //alert(&quot;Table #&quot; + i);<br />        var tablethtags = starttable&lt;i&gt;.getElementsByTagName(&quot;th&quot;);<br />        for (var k = 0 ; k &lt; tablethtags.length ; k++) {<br />          if (max_cell_width &lt; tablethtags[k].offsetWidth) {max_cell_width = tablethtags[k].offsetWidth;}<br />        }<br />        var tabletdtags = starttable&lt;i&gt;.getElementsByTagName(&quot;td&quot;);<br />        for (var k = 0 ; k &lt; tabletdtags.length ; k++) {<br />          if (max_cell_width &lt; tabletdtags[k].offsetWidth) {max_cell_width = tabletdtags[k].offsetWidth;}<br />        }<br />        var status_string = &quot;&quot;;<br />        for (var k = 0 ; k &lt; tablethtags.length ; k++) {<br />          status_string = status_string + &quot;Setting the width of table th tag #&quot; + k + &quot; , Max Cell Width = &quot; + max_cell_width + &quot;\n\r&quot;;<br />          tablethtags[k].width = max_cell_width;<br />        }<br />        //alert(status_string);<br />        status_string = &quot;&quot;;<br />        for (var k = 0 ; k &lt; tabletdtags.length ; k++) {<br />          tabletdtags[k].width = max_cell_width;<br />          status_string = status_string + &quot;Setting the width of table th tag #&quot; + k + &quot; , Max Cell Width = &quot; + max_cell_width + &quot;\n\r&quot;;<br />        }<br />        //alert(status_string);<br />        status_string = &quot;&quot;;<br />        var headers = starttable&lt;i&gt;.getElementsByTagName(&quot;thead&quot;);<br />        alert(&quot;var headers ok&quot;);<br />        var tablebodys = starttable&lt;i&gt;.getElementsByTagName(&quot;tbody&quot;);<br />        alert(&quot;var tablebodys ok&quot;);<br />        var newtablehtml = &quot;&quot;;<br />        alert(&quot;newtablehtml clear ok&quot;);<br />        newtablehtml = newtablehtml + &quot;&lt;div class=\&quot;headertablediv\&quot;&gt;\n\r&lt;table &quot; + tableheadstring + &quot;&gt;\n\r&quot;;<br />        alert(&quot;1&quot;);<br />        newtablehtml = newtablehtml + &quot;  &lt;thead&gt;\n\r&quot; + headers[0].innerHTML + &quot;\n\r  &lt;/thead&gt;\n\r&lt;/table&gt;\n\r&lt;/div&gt;\n\r&quot;;<br />        alert(&quot;2&quot;);<br />        newtablehtml = newtablehtml + &quot;&lt;div class=\&quot;bodytablediv\&quot;&gt;\n\r&lt;table &quot; + tabletbodystring + &quot;&gt;\n\r&quot;;<br />        alert(&quot;3&quot;);<br />        newtablehtml = newtablehtml + &quot;  &lt;tbody&gt;\n\r&quot; + tablebodys[0].innerHTML + &quot;&lt;/tbody&gt;\n\r&lt;/table&gt;\n\r&lt;/div&gt;\n\r&quot;;<br />        alert(newtablehtml);<br />        table1div.innerHTML = newtablehtml;<br />//        table1div.innerHTML = &quot;&lt;table &quot; + tabletheadstring + &quot;&gt;\n\r  &lt;head&gt;\n\r&quot; + headers&lt;i&gt;.innerHTML + &quot;&lt;/head&gt;\n\r&lt;/table&gt;\n\r&quot; + &quot;&lt;table &quot; + tabletbodystring + &quot;&gt;\n\r  &lt;head&gt;\n\r&quot; + tablebodys&lt;i&gt;.innerHTML + &quot;&lt;/head&gt;\n\r&lt;/table&gt;\n\r&quot;;<br />      }<br />      <br />    }<br />  &lt;/script&gt;<br />  <br />  &lt;style type=&quot;text/css&quot;&gt;<br />    .widthadjuster {<br />    }<br />    .heightadjuster {<br />    <br />    }<br />    .theadtable {<br />      position:fixed;<br />      border:3px #ff9900 solid;<br />      margin:2em 2em 0em 2em;<br />    }<br />    .tbodytable {<br />      top:4em;<br />      border:3px #ff9900 solid;<br />      margin:0em 2em 0em 2em;<br />    }<br />    .tablebase {<br />      width:90%;<br />      border:3px #ff9900 solid;<br />      margin:2em 2em 2em 2em;<br />    }<br />    th , tr , td {<br />      border:1px black solid;<br />    }<br />    #table1 {<br />    }<br />    div {<br />      background-color:#993399;<br />    }<br />    .outerdiv {<br />      <br />    }<br />    .headertablediv {<br />    <br />    }<br />    .bodytablediv {<br />      overflow:auto;<br />      height:5em;<br />    }<br />  &lt;/style&gt;<br />&lt;/head&gt;</p><p>&lt;body style=&quot;background-color:#FFCCFF;&quot;&gt;</p><p>  </p><h2>Working with javascript to change the layout and properties of an html table</h2><p>
  &lt;hr style=&quot;width:100%; height:5px; color:#006600; background-color:#006600;&quot; /&gt;<br />  <br />  &lt;div id=&quot;table1&quot;&gt;<br />    &lt;table cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; class=&quot;tablebase&quot;&gt;<br />      <thead>
        <tr>
          <th>Header Cell</th><th>Header Cell</th><th>Header Cell</th><th>Header Cell</th>
        </tr>
      </thead><br />      <tbody>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        <tr>
          <th>Row Header</th><td>Data Cell</td><td>Data Cell</td><td>Data Cell</td>
        </tr>
        
      </tbody><br />    &lt;/table&gt;<br />  &lt;/div&gt;<br />  <br />  &lt;br /&gt;<br />  &lt;button style=&quot;align:center;&quot; onclick=&quot;SplitTable()&quot;&gt;Press this button to split the table above into two tables below&lt;/button&gt;<br />  &lt;br /&gt;<br />  <br />  &lt;div id=&quot;splitscrolltable&quot;&gt;<br />    <br />  &lt;/div&gt;<br />  </p><p>&lt;/body&gt;</p><p>&lt;/html&gt;</p><p>&lt;/code&gt;</p><p>I had already used a string var in that manner before with success though , and I don&#39;t see what is different that would cause it to fail.
</p><div class="source-code snippet"><div class="inner"><pre>var mystring <span class="k3">=</span> <span class="s">""</span><span class="k2">;</span>
mystring <span class="k3">=</span> mystring <span class="k3">+</span> <span class="s">"Javascript is weird , man"</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span>mystring<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
There&#39;s nothing wrong with javascript like that is there?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 27 Jan 2008 19:21:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>JavaScript has the <tt>+=</tt> operator, which also works for string concatenation. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> Probably not the problem though. I&#39;m not sure why you&#39;re concatenating <tt>\n\r</tt> to your strings. A <tt>\n</tt> should suffice... Probably still isn&#39;t the problem though.</p><p> <i>** EDIT **</i></p><p>The error that I get is: &quot;<tt>tableheadstring</tt> is not defined.&quot;
</p><div class="quote_container"><div class="title">Edgar Reynaldo said:</div><div class="quote"><p>
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">// ...</span>

newtablehtml <span class="k3">=</span> newtablehtml <span class="k3">+</span> <span class="s">"&lt;div class=\"headertablediv\"&gt;\n\r&lt;table "</span> <span class="k3">+</span> tableheadstring <span class="k3">+</span> <span class="s">"&gt;\n\r"</span><span class="k2">;</span>

<span class="c">// ...</span>
</pre></div></div><p>
</p></div></div><p>
Perhaps you meant <tt>tabletheadstring</tt>? How are you debugging this? Firefox&#39;s Firebug extension told me exactly where and what the error was so if you&#39;re not using it you should be. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 27 Jan 2008 22:26:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Stupid typos.<br />I tried using SeaMonkey&#39;s javascript debugger Venkman , but I don&#39;t know how to use it very well and when I closed Venkman , SeaMonkey locked up. Every time I tried to click on the page or open or close it , it just beeped at me. Beep. Beep. Argh!<br />I&#39;ve got FireFox and Firebug installed now , I&#39;ll use them next time. Thanks for spotting my mistake.</p><p>- <b>Update</b> -<br />Firefox&#39;s error console (menu-&gt;tools-&gt;error console) is quite handy for catching typographical errors. SeaMonkey has one too (menu-&gt;tools-&gt;web development-&gt;error console).</p><p>The most effective method I&#39;ve found so far for making a table&#39;s body scroll is by splitting the table up into two tables contained in their own &lt;div&gt; tags , using one table for the &lt;thead&gt; section and one for the &lt;tbody&gt; section.</p><p>Right now I&#39;m having trouble figuring out the best way to implement the javascript that does this though. I can use document.getElementsByTagName(&quot;table&quot;) to get a collection of all the tables in the document. Once I have this I can extract the table header and table body for use in modifying the table into the form mentioned earlier. I&#39;d like to be able to make this javascript capable of scanning any html document for tables of a certain class so they can be made into scrolling tables. My question is how do I make an array that contains only the tables that are meant to be transformed? I suppose my actual question is how do I declare an array of the appropriate object type so I can assign table elements to it based on their class?</p><p>Another question is once I have the tables and I know what I want to replace them with how would I cut out just the table and paste in the new html? Should I try to find out the parent node of the table and then delete the table node? How would I know which table node to delete if there was more than one in its parent node?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 31 Jan 2008 14:32:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>To answer one question:
</p><div class="source-code snippet"><div class="inner"><pre>var tables <span class="k3">=</span> <span class="k2">[</span><span class="k2">]</span><span class="k2">;</span> <span class="c">// create an empty array</span>

var e <span class="k3">=</span> document.getElementsByTagName<span class="k2">(</span><span class="s">"table"</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// find all tables</span>
<span class="k1">for</span> <span class="k2">(</span>var i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> e.length<span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>i<span class="k2">)</span>              <span class="c">// loop through them</span>
  <span class="k1">if</span> <span class="k2">(</span>e.className.indexOf<span class="k2">(</span><span class="s">"splitTable"</span><span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> <span class="k3">-</span><span class="n">1</span><span class="k2">)</span>  <span class="c">// check its class name</span>
    tables.push<span class="k2">(</span>e<span class="k2">)</span><span class="k2">;</span>                             <span class="c">// add it to the array</span>

<span class="c">// now loop through the array and work on the tables</span>
<span class="k1">for</span> <span class="k2">(</span>var i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> tables.length<span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>i<span class="k2">)</span>
  splitTable<span class="k2">(</span>tables<span class="k3">&lt;</span>i&gt;<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
You don&#39;t declare types of arrays or any other variable. An array can hold any mix of values.</p><p>Note that calls like getElementsByTagName() may return an active list, which can be confusing. For instance:</p><div class="source-code snippet"><div class="inner"><pre>var e <span class="k3">=</span> document.getElementsByTagName<span class="k2">(</span><span class="s">"table"</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// find all tables</span>
<a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span>e.length<span class="k2">)</span><span class="k2">;</span> 
document.body.appendChild<span class="k2">(</span>document.createElement<span class="k2">(</span><span class="s">"table"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// add another table</span>
<a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span>e.length<span class="k2">)</span><span class="k2">;</span> <span class="c">// should be one more than the previous call</span>
</pre></div></div><p>

That&#39;s why it&#39;s best to add them to an array if you plan on doing any modifications (which you are).</p><p>Note that if you were using some 3rd party JavaScript library it may be as simple as:
</p><div class="source-code snippet"><div class="inner"><pre>document.getElementsByClassName<span class="k2">(</span><span class="s">"splitTable"</span><span class="k2">)</span>.each<span class="k2">(</span>function<span class="k2">(</span>t<span class="k2">)</span>
<span class="k2">{</span>
  splitTable<span class="k2">(</span>t<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 01 Feb 2008 00:03:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay , I&#39;m making some sort of progress I think.</p><p>I&#39;ve got an array of just the tables that have the appropriate class attribute and I&#39;m working on preserving the rest of the attributes for the table to be passed on to the transformed tables. However , I can&#39;t seem to figure out how to use the javascript string object replace method very well. I&#39;d like to preserve the other classes that the table has if there are any so I&#39;ve been trying this on the class node :
</p><div class="source-code snippet"><div class="inner"><pre>var classnodevalue <span class="k3">=</span> classnode.nodeValue<span class="k2">;</span>
<span class="k1">if</span> <span class="k2">(</span>classnodevalue <span class="k3">=</span><span class="k3">=</span> <span class="s">"makescroll"</span><span class="k2">)</span> <span class="k2">{</span>
  table_attributes.removeNamedItem<span class="k2">(</span><span class="s">"class"</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span><span class="s">"Removed class attribute from table"</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span> <span class="k1">else</span> <span class="k2">{</span>
  <span class="c">// this doesn't work</span>
  classnodevalue.replace<span class="k2">(</span><span class="k3">/</span>makescroll<span class="k3">/</span> , <span class="s">""</span><span class="k2">)</span><span class="k2">;</span>
  <span class="c">// this doesn't work either</span>
  classnodevalue.replace<span class="k2">(</span><span class="s">"makescroll"</span> , <span class="s">""</span><span class="k2">)</span><span class="k2">;</span>

  classnode.nodeValue <span class="k3">=</span> classnodevalue<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

I&#39;ve been going by what&#39;s here : <a href="http://www.w3schools.com/jsref/jsref_replace.asp">w3schools javascript string replace reference</a><br />I&#39;ve tried their editable examples but I can&#39;t get it to actually modify the string. It looks like the replace method returns a string that has had part of it replaced , but it doesn&#39;t modify the string itself. Anyone know what I&#39;m doing wrong?</p><p>- Update -<br />I ditched the replace method and I&#39;m using substr() instead now and it works fine to build a new string minus the &#39;makescroll&#39;. Note that I won&#39;t actually be removing the class attribute of the table but replacing the table node entirely.</p><p>This is a valid regular expression right?<br /> </p><pre>/makescroll/</pre><p>
I&#39;ve never used them before and they look pretty bizarre. Anyway , on to building the new tables.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 01 Feb 2008 18:20:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><tt>replace()</tt> doesn&#39;t modify the string.</p><p>I wouldn&#39;t necessarily remove the class name. It could be useful for styling the table via CSS. But in general, it&#39;s handy to create some functions called <tt>removeClassName()</tt>, <tt>hasClassName()</tt>, and <tt>addClassName()</tt>.</p><p>e.g.,
</p><div class="source-code snippet"><div class="inner"><pre>function removeClassName<span class="k2">(</span>e, className<span class="k2">)</span>
<span class="k2">{</span>
  e.className <span class="k3">=</span> e.className
   .replace<span class="k2">(</span><span class="k1">new</span> RegExp<span class="k2">(</span><span class="s">"(^|\\s+)"</span> <span class="k3">+</span> className <span class="k3">+</span> <span class="s">"($|\\s+)"</span><span class="k2">)</span>, <span class="s">" "</span><span class="k2">)</span>
   .replace<span class="k2">(</span><span class="k3">/</span>^\s<span class="k3">+</span><span class="k3">|</span>\s<span class="k3">+</span>$<span class="k3">/</span>g,<span class="s">""</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

That would remove the class name and trim the white space.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 01 Feb 2008 21:45:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Matthew Leverton said:</div><div class="quote"><p>
<tt>replace()</tt> doesn&#39;t modify the string.
</p></div></div><p>
This caught me a few days ago... <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sat, 02 Feb 2008 00:10:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Matthew&#39;s code:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span>e.className.indexOf<span class="k2">(</span><span class="s">"splitTable"</span><span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> <span class="k3">-</span><span class="n">1</span><span class="k2">)</span>  <span class="c">// check its class name</span>
</pre></div></div><p>

I started out thinking a regex would be simpler, but its actually a bit uglier...  Anyway, this is slightly more accurate:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span><span class="k3">/</span><span class="k2">(</span>^<span class="k3">|</span>\.<span class="k3">|</span> <span class="k2">)</span>splitTable<span class="k2">(</span>$<span class="k3">|</span>\.<span class="k3">|</span> <span class="k2">)</span><span class="k3">/</span>.test<span class="k2">(</span>e.className<span class="k2">)</span><span class="k2">)</span>  <span class="c">// check its class name</span>
</pre></div></div><p>

Here is a way to do it with less typing:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span><span class="k2">(</span><span class="k3">/</span>splitTable<span class="k3">/</span>.test<span class="k2">(</span>e.className<span class="k2">)</span><span class="k2">)</span>  <span class="c">// check its class name</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dustin Dettmer)</author>
		<pubDate>Sat, 02 Feb 2008 05:13:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I didn&#39;t want to confuse him with regular expressions at that point. But yes, your second method is a simpler way to do the same thing.</p><p>Your first expression is incorrect though. There&#39;s no need to include the dot. And the HTML might have any sort of whitespace separating the class names. Browsers may internally treat them as a single space, but that&#39;s not guaranteed.</p><p>This is why I wrote:
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
it&#39;s handy to create some functions called removeClassName(), hasClassName(), and addClassName().
</p></div></div><p>
And the more you start using JS, the more you realize all of these common things have already been packaged nicely into third party libraries. They may add about 35K of overhead, but they remove a lot of headaches and shorten your code up considerably.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sat, 02 Feb 2008 05:52:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was trying to catch stuff like this:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k3">&lt;</span>style&gt;
.link.awesome <span class="k2">{</span>
 ...
<span class="k2">}</span>
<span class="k3">&lt;</span><span class="k3">/</span>style&gt;
<span class="k3">&lt;</span>a <span class="k1">class</span><span class="k3">=</span><span class="s">"link.awesome"</span><span class="k3">&gt;</span>...<span class="k3">&lt;</span><span class="k3">/</span>a&gt;
</pre></div></div><p>

But the idea is silly anyway.  If you&#39;re going to parse CSS stuff you should either 1) keep it simple or 2) do the whole thing.  You would have to check tag names and a bunch of other stuff to be CSS-ly accurate.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dustin Dettmer)</author>
		<pubDate>Sat, 02 Feb 2008 06:00:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>But it&#39;s written as:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k3">&lt;</span>a <span class="k1">class</span><span class="k3">=</span><span class="s">"link awesome"</span><span class="k3">&gt;</span>...<span class="k3">&lt;</span><span class="k3">/</span>a&gt;
</pre></div></div><p>
Nobody is talking about parsing CSS or HTML&mdash;just the className property of elements.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sat, 02 Feb 2008 06:09:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>IE&#39;s being a gigantic lamer again.</p><div class="source-code snippet"><div class="inner"><pre>        <span class="k1">if</span> <span class="k2">(</span>tableheaders.length <span class="k3">&gt;</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
          var scrolltableheaderdiv <span class="k3">=</span> <span class="k2">(</span>tables_to_fix<span class="k3">&lt;</span>i&gt;.parentNode<span class="k2">)</span>.insertBefore<span class="k2">(</span>document.createElement<span class="k2">(</span><span class="s">"div"</span><span class="k2">)</span> , tables_to_fix<span class="k3">&lt;</span>i&gt;<span class="k2">)</span><span class="k2">;</span>
          var scrolltableheaderdivtable <span class="k3">=</span> scrolltableheaderdiv.appendChild<span class="k2">(</span>document.createElement<span class="k2">(</span><span class="s">"table"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
          var scrolltableheaderdivtableheader <span class="k3">=</span> scrolltableheaderdivtable.appendChild<span class="k2">(</span>document.createElement<span class="k2">(</span><span class="s">"thead"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
          var headerattributes <span class="k3">=</span> tableheaders<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.attributes<span class="k2">;</span>
          <span class="k1">for</span> <span class="k2">(</span>var j <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> j <span class="k3">&lt;</span> headerattributes.length <span class="k2">;</span> j<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <span class="k2">{</span>
            newattribute <span class="k3">=</span> document.createAttribute<span class="k2">(</span>headerattributes.item<span class="k2">(</span>j<span class="k2">)</span>.nodeName<span class="k2">)</span><span class="k2">;</span>
            newattribute.value <span class="k3">=</span> headerattributes.item<span class="k2">(</span>j<span class="k2">)</span>.nodeValue<span class="k2">;</span>
            scrolltableheaderdivtableheader.setAttributeNode<span class="k2">(</span>newattribute<span class="k2">)</span><span class="k2">;</span>
          <span class="k2">}</span>
          scrolltableheaderdivtableheader.innerHTML <span class="k3">=</span> column_specs <span class="k3">+</span> tableheaders<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.innerHTML<span class="k2">;</span>
        <span class="k2">}</span>
</pre></div></div><p>

IE chokes on this line :
</p><div class="source-code snippet"><div class="inner"><pre>            scrolltableheaderdivtableheader.setAttributeNode<span class="k2">(</span>newattribute<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
and says :<br /> <span class="remote-thumbnail"><span class="json">{"name":"594414","src":"http:\/\/static.allegro.cc\/image\/cache\/4\/0\/40926f010225eb04d6bb686c6df55c0c.jpg","w":453,"h":299,"tn":"http:\/\/static.allegro.cc\/image\/cache\/4\/0\/40926f010225eb04d6bb686c6df55c0c"}</span><img src="http://static.allegro.cc/image/cache/4/0/40926f010225eb04d6bb686c6df55c0c-240.jpg" alt="594414" width="240" height="158" /></span><br />So I guess IE7 doesn&#39;t recognize the setAttributeNode method?<br />Does anyone know a suitable replacement?</p><p>Also , I ran my page through the <a href="http://validator.w3.org/">The W3C Markup Validation Service</a> and after fixing an extra slash in my dtd and adding a meta tag for document encoding , it tells me the &lt;nobr&gt; tag is invalid , even though it works on SeaMonkey , FireFox , and IE7. I replaced that with CSS for th and td tags using white-space:pre; and that seems to do nicely and the validator gave it the thumbs up.</p><p>So any idea what I can do to find a replacement for the setAttributeNode method that will work cross-browsers?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 05 Feb 2008 08:50:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see you like extremely long variable names...</p><p>In general, you can just do this:
</p><div class="source-code snippet"><div class="inner"><pre>var <a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k3">=</span> document.createElement<span class="k2">(</span><span class="s">"div"</span><span class="k2">)</span><span class="k2">;</span>
div.attributeName <span class="k3">=</span> value<span class="k2">;</span>
</pre></div></div><p>
And on some occasions (due to quirks in browsers), this version is needed:
</p><div class="source-code snippet"><div class="inner"><pre>var <a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> <span class="k3">=</span> document.createElement<span class="k2">(</span><span class="s">"div"</span><span class="k2">)</span><span class="k2">;</span>
div.setAttribute<span class="k2">(</span><span class="s">"attributeName"</span>, value<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 05 Feb 2008 10:02:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I changed all the attribute setting to use .setAttribute which gives this :<br /> </p><div class="source-code snippet"><div class="inner"><pre>        <span class="k1">if</span> <span class="k2">(</span>tableheaders.length <span class="k3">&gt;</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
          var scrolltableheaderdiv <span class="k3">=</span> <span class="k2">(</span>tables_to_fix<span class="k3">&lt;</span>i&gt;.parentNode<span class="k2">)</span>.insertBefore<span class="k2">(</span>document.createElement<span class="k2">(</span><span class="s">"div"</span><span class="k2">)</span> , tables_to_fix<span class="k3">&lt;</span>i&gt;<span class="k2">)</span><span class="k2">;</span>
          var scrolltableheaderdivtable <span class="k3">=</span> scrolltableheaderdiv.appendChild<span class="k2">(</span>document.createElement<span class="k2">(</span><span class="s">"table"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
          var scrolltableheaderdivtableheader <span class="k3">=</span> scrolltableheaderdivtable.appendChild<span class="k2">(</span>document.createElement<span class="k2">(</span><span class="s">"thead"</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
          var headerattributes <span class="k3">=</span> tableheaders<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.attributes<span class="k2">;</span>
          <span class="k1">for</span> <span class="k2">(</span>var j <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> j <span class="k3">&lt;</span> headerattributes.length <span class="k2">;</span> j<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> <span class="k2">{</span>
            scrolltableheaderdivtableheader.setAttribute<span class="k2">(</span>headerattributes.item<span class="k2">(</span>j<span class="k2">)</span>.nodeName , headerattributes.item<span class="k2">(</span>j<span class="k2">)</span>.nodeValue<span class="k2">)</span><span class="k2">;</span>
          <span class="k2">}</span>
          scrolltableheaderdivtableheader.innerHTML <span class="k3">=</span> column_specs <span class="k3">+</span> tableheaders<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.innerHTML<span class="k2">;</span>
        <span class="k2">}</span>
</pre></div></div><p>
but then IE gives me this in response :<br /> http://www.allegro.cc/files/attachment/594415</p><p>and here&#39;s line 118 which IE didn&#39;t like :
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">//</span>
          scrolltableheaderdivtableheader.innerHTML <span class="k3">=</span> column_specs <span class="k3">+</span> tableheaders<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.innerHTML<span class="k2">;</span>
<span class="c">//</span>
</pre></div></div><p>

If I use this to set an attribute then how do I set the attribute&#39;s value? :
</p><div class="source-code snippet"><div class="inner"><pre>element.attributeName <span class="k3">=</span> section.item<span class="k2">(</span>j<span class="k2">)</span>.nodeName<span class="k2">;</span>
</pre></div></div><p>
Or did you mean that I should say
</p><div class="source-code snippet"><div class="inner"><pre>element.<span class="s">"actualattribute"</span> <span class="k3">=</span> section.item<span class="k2">(</span>j<span class="k2">)</span>.nodeValue<span class="k2">;</span>
</pre></div></div><p>
where &quot;actualattribute&quot; is a hard-coded string literal?</p><p>I don&#39;t think this would work :
</p><div class="source-code snippet"><div class="inner"><pre>element.<span class="k2">(</span>section.item<span class="k2">(</span>j<span class="k2">)</span>.nodeName<span class="k2">)</span> <span class="k3">=</span> section.item<span class="k2">(</span>j<span class="k2">)</span>.nodeValue<span class="k2">;</span>
</pre></div></div><p>

All I want to do is to make sure that I pass on whatever attributes the original table&#39;s header , footer , and body had on to the new &lt;div&gt;&lt;table&gt;&lt;thead&gt;/// , &lt;div&gt;&lt;table&gt;&lt;tbody&gt;/// , &lt;div&gt;&lt;table&gt;&lt;tfoot&gt;/// elements.</p><p><s>Edit</s><br />Maybe I should just be using .childNodes and loop through them using .appendChild?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 05 Feb 2008 11:17:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">MSDN on innerHTML said:</div><div class="quote"><p>
The property is read/write for all objects except the following, for which it is read-only: COL, COLGROUP, FRAMESET, HEAD, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE, TR. The property has no default value.
</p></div></div><p>
Your code is too verbose for me to read. So that may or may not apply to what you are doing. IE won&#39;t let you <tt>table.innerHTML = &quot;&lt;tr&gt; ...&quot;</tt> although you could do something like <tt>div.innerHTML = &quot;&lt;table&gt; ... &lt;/table&gt;&quot;</tt>.</p><p>In fifty words or less, what is the purpose of your above code snippet?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 05 Feb 2008 11:47:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>IE sucks.</p><p>My purpose :<br />Transfer each of the original table&#39;s thead , tfoot , and tbody into a new &lt;div&gt;&lt;table&gt; for each of them. I want to preserve the attributes of the original table and preserve the attributes of the thead , tfoot , and tbody elements as well.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 05 Feb 2008 11:55:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You could do something like:
</p><div class="source-code snippet"><div class="inner"><pre>var t2 <span class="k3">=</span> t1.cloneNode<span class="k2">(</span><span class="k1">true</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
But I don&#39;t know why you would need to clone an entire table. It seems to me that (if we are talking about the original subject) all you would have to do is create a second table, remove the THEAD from the original table, and append it to the second table (which would precede the original table in the DOM).</p><p>Then resize the table headers to fit the widths of the columns in the original table.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 05 Feb 2008 12:03:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes , that would be ideal , I agree.</p><p>The problem is that to get proper scrolling in all the browsers , I have to include the table body in a separate &lt;div&gt; with overflow:auto; and a height to get it to scroll properly in all the browsers.</p><p>The trouble I run into is that when I have the list of tables to modify , if I use tables_to_fix.getElementsByTagName(thead or tfoot or tbody) then how do I copy that entire element into the new table? Is an element also a node itself? Could I clone it and then use .appendChild(clone) in the new table?</p><p>I suppose another option is to get the childNodes of the original table and then filter them into thead , tfoot , and tbody nodes by checking .nodeName so I can use them with .appendChild(). Would I need to clone those then?</p><p>Basically , my overall objective is to preserve the original formatting of the entire table through it&#39;s transformation into this format :
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k3">&lt;</span>div&gt;</td></tr><tr><td class="number">2</td><td>  <span class="k3">&lt;</span>table&gt;</td></tr><tr><td class="number">3</td><td>    <span class="k3">&lt;</span>thead&gt;</td></tr><tr><td class="number">4</td><td>    <span class="k3">&lt;</span><span class="k3">/</span>thead&gt;</td></tr><tr><td class="number">5</td><td>  <span class="k3">&lt;</span><span class="k3">/</span>table&gt;</td></tr><tr><td class="number">6</td><td><span class="k3">&lt;</span><span class="k3">/</span>div&gt;</td></tr><tr><td class="number">7</td><td><span class="k3">&lt;</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_134.html" target="_blank">div</a> style<span class="k3">=</span><span class="s">"overflow:auto; height:100px;"</span><span class="k3">&gt;</span></td></tr><tr><td class="number">8</td><td>  <span class="k3">&lt;</span>table&gt;</td></tr><tr><td class="number">9</td><td>    <span class="k3">&lt;</span>tbody&gt;</td></tr><tr><td class="number">10</td><td>    <span class="k3">&lt;</span><span class="k3">/</span>tbody&gt;</td></tr><tr><td class="number">11</td><td>  <span class="k3">&lt;</span><span class="k3">/</span>table&gt;</td></tr><tr><td class="number">12</td><td><span class="k3">&lt;</span><span class="k3">/</span>div&gt;</td></tr><tr><td class="number">13</td><td><span class="k3">&lt;</span>div&gt;</td></tr><tr><td class="number">14</td><td>  <span class="k3">&lt;</span>table&gt;</td></tr><tr><td class="number">15</td><td>    <span class="k3">&lt;</span>tfoot&gt;</td></tr><tr><td class="number">16</td><td>    <span class="k3">&lt;</span><span class="k3">/</span>tfoot&gt;</td></tr><tr><td class="number">17</td><td>  <span class="k3">&lt;</span><span class="k3">/</span>table&gt;</td></tr><tr><td class="number">18</td><td><span class="k3">&lt;</span><span class="k3">/</span>div&gt;</td></tr></tbody></table></div></div><p>

One thing I don&#39;t understand though is that a &lt;div&gt; will shrink to fit it&#39;s contents vertically , but why not horizontally as well? So I have to set their widths also. Not to mention that SeaMonkey&#39;s vertical scroll bars are 15 pixels wide while FireFox and IE&#39;s scroll bars are 17 pixels wide.</p><p><s>Edit</s><br />Okay , I figured out that getElementsByTagName returns a NodeList of element nodes. Appending a cloned node to the new table is working fine , but there still remains the matter of transferring the attributes of the old table to the new table. The point is that if the original table had CSS , attributes , whatever , I want to preserve that. I realize that I&#39;ll have to make some modifications to the table&#39;s border frames so that borders don&#39;t appear between the table header and body and between the table body and footer but I guess that&#39;s the way it goes.</p><p><s>Edit2</s><br />Turns out that transferring the attributes of the table wasn&#39;t that hard after all. I used 
</p><div class="source-code snippet"><div class="inner"><pre>var table_prototype <span class="k3">=</span> tables_to_fix<span class="k3">&lt;</span>i&gt;.cloneNode<span class="k2">(</span><span class="k1">false</span><span class="k2">)</span><span class="k2">;</span>
headerdiv.appendChild<span class="k2">(</span>table_prototype.cloneNode<span class="k2">(</span><span class="k1">true</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
and fixed up table_prototype&#39;s class attributes to remove the makescroll class.</p><p>Now working on setting the column widths among the different div tables using a clone of a new &lt;colgroup&gt; tag that&#39;s been set with the different column widths.<br />Now , how to simply fix up each div table&#39;s border frames and margins.</p><p><s><b>Edit3</b></s><br />From <a href="http://msdn2.microsoft.com/en-us/library/ms534651(VS.85).aspx">MSDN STYLE reference page</a>
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Remarks</p><p>    This attribute is not accessible through scripting. To access styles through scripting, use the style object.
</p></div></div><p>
 <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" />   It turns out that IE doesn&#39;t support changing an objects inline style attributes through scripting , only through scripting changes in the document&#39;s &lt;head&gt; &lt;style&gt; tag&#39;s values. Okay , so to jump through the next IE hoop , I have to edit the innerHTML of the &lt;style&gt; tag. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Can anyone see what is wrong with these lines? IE says an unknown runtime error happened in the third line.
</p><div class="source-code snippet"><div class="inner"><pre>      var htmlheads <span class="k3">=</span> document.getElementsByTagName<span class="k2">(</span><span class="s">"head"</span><span class="k2">)</span><span class="k2">;</span>
      var headstyles <span class="k3">=</span> htmlheads<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.getElementsByTagName<span class="k2">(</span><span class="s">"style"</span><span class="k2">)</span><span class="k2">;</span>
      headstyles<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.innerHTML <span class="k3">=</span> headstyles<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>.innerHTML <span class="k3">+</span> <span class="s">".scrolldiv {\n\r  overflow:auto;\n\r  height:"</span> <span class="k3">+</span> tablebodyheight <span class="k3">+</span> <span class="s">";\n\r}"</span><span class="k2">;</span>
<span class="c">//</span>
</pre></div></div><p>
Did I construct the new string incorrectly?</p><p><s><b>Edit4</b></s><br /><a href="http://msdn2.microsoft.com/en-us/library/ms533897(VS.85).aspx">MSDN innerHTML reference page</a><br />!@#$ .innerHTML is read only for the &lt;style&gt; tag. <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" /><br />So what am I supposed to do to get this to work in IE? Do I have to link in an external style sheet now? W  T  F  ?</p><p>What if I copy the innerHTML out of the style tag , alter it , delete the style node and create a new one with the altered innerHTML? Same problem. @#$%.</p><p>Okay , the inner HTML is also contained within it&#39;s childNode[0].nodeValue of the style node , at least in FireFox it is. So maybe I can clone the node , alter childNode[0].nodeValue of the clone , and then pull a switcheroo. This is really tiresome. It shouldn&#39;t take major innovation just to get a table to scroll properly. Maybe I&#39;ll email this thread out to W3C and the browsers and see what they think of this crap.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 05 Feb 2008 16:56:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I don&#39;t think this would work :</p><p>element.(section.item(j).nodeName) = section.item(j).nodeValue;
</p></div></div><p>
These two lines are equivalent.
</p><div class="source-code snippet"><div class="inner"><pre>element.shoes <span class="k3">=</span> <span class="s">'worn'</span><span class="k2">;</span>
element<span class="k2">[</span><span class="s">'shoes'</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">'worn'</span><span class="k2">;</span>
</pre></div></div><p>

.. and stop using innerHTML.  It&#39;s a hack that should be avoided at nearly all costs.</p><p>There are very few legitimate uses for it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dustin Dettmer)</author>
		<pubDate>Wed, 06 Feb 2008 00:49:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That doesn&#39;t work to set the style attribute of a &lt;div&gt; tag though.
</p><div class="source-code snippet"><div class="inner"><pre>scrolltablebodydiv.style <span class="k3">=</span> <span class="s">"overflow:auto; height:"</span> <span class="k3">+</span> tablebodyheight <span class="k3">+</span> <span class="s">"px;"</span><span class="k2">;</span>
</pre></div></div><p>

In IE7 it tells me &#39;member not found&#39; for that line.<br />In SeaMonkey and FireFox it tells me I&#39;m &#39;setting a property that only has a getter&#39;.</p><p>I can set the class attribute of the div but then I have to have the class defined outside of the script and I&#39;d like to have it added to the inline &lt;style&gt; tag of the page , which I have not found a way to do considering the entire &lt;style&gt; tag object is read-only in Internet Explorer. Any suggestions?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 06 Feb 2008 18:29:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You have to set the properties individually:
</p><div class="source-code snippet"><div class="inner"><pre>div.style.overflow <span class="k3">=</span> <span class="s">"auto"</span><span class="k2">;</span>
div.style.height <span class="k3">=</span> tablebodyheight <span class="k3">+</span> <span class="s">"px"</span><span class="k2">;</span>
</pre></div></div><p>
Any property that has a dash just uses upper case letters. e.g., <tt>max-width</tt> becomes <tt>maxWidth</tt>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 06 Feb 2008 21:27:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Awesome , that did it , even in IE7! Thanks! Now I don&#39;t need to mess about with the &lt;style&gt; tag element. Do you know if/how that is possible in IE7?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 06 Feb 2008 22:19:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Google on <tt>document.styleSheets</tt>. There is the standard W3C way and the IE way. It&#39;s not widely used though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 06 Feb 2008 22:30:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Dustin Dettmer said:</div><div class="quote"><p>
.. and stop using innerHTML. It&#39;s a hack that should be avoided at nearly all costs.
</p></div></div><p>
<a href="http://www.allegro.cc/forums/thread/595040">I learned this the hard way</a>. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 08 Feb 2008 01:47:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I had to know this wouldn&#39;t be as simple as adding in a &lt;colgroup&gt; node to each new table. IE7 decided that when there&#39;s a &lt;col width=&quot;#px&quot;&gt; tag in a &lt;colgroup&gt; of a table that only the inner section of a &lt;th&gt; or &lt;td&gt; tag should be that wide. Firefox decided that the entire column including padding and border should be that wide. Why can&#39;t there just be one !@#$ way to do everything in all the browsers?</p><p>Should I just manually set the widths of each and every &lt;th&gt; and &lt;td&gt; tag?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 10 Feb 2008 16:08:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Should I just manually set the widths of each and every &lt;th&gt; and &lt;td&gt; tag?
</p></div></div><p>
Just set the widths on the first row of the tables. (I&#39;m assume there are no colspans.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 10 Feb 2008 21:55:29 +0000</pubDate>
	</item>
</rss>

