Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14918

Re: Creating tables on the fly using ---> var tbl=document.createElement("table");

From David Mark <dmark.cinsoft@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Creating tables on the fly using ---> var tbl=document.createElement("table");
Date 2012-07-06 14:47 -0700
Organization http://groups.google.com
Message-ID <4d7460bf-ebc3-4d59-939a-e5f279546787@googlegroups.com> (permalink)
References <2f39371c-f9f1-41f8-979c-ce7dd73db1a3@googlegroups.com> <27a7dd89-db1c-4eb5-b6bf-269d847b7d90@googlegroups.com>

Show all headers | View raw


On Friday, July 6, 2012 11:21:24 AM UTC-4, Bob wrote:
> On Friday, July 6, 2012 1:25:25 AM UTC-4, Bob wrote:
> > Like this
> > 
> >         var tbl=document.createElement("table");
> > 
> > Then I want to make the table width 100% like this
> > 
> >         tbl.setAttribute('width','100%');
> > 
> > It only works some of the time. As I'm dynamically adding rows and cells the table shrinks to a much small width and looks crummy.
> > 
> > Anybody got any ideas?
> > 
> > Thanks in advance,
> > 
> > Bob Sweeney
> 
> Can you supply an example of how you would do that?

With CSS (e.g. width: 100%). Or I would set the "width" property (as opposed to using the dreaded setAttribute method).

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Creating tables on the fly using --->   var tbl=document.createElement("table"); Bob <Go1369@yahoo.com> - 2012-07-05 22:25 -0700
  Re: Creating tables on the fly using --->   var tbl=document.createElement("table"); David Mark <dmark.cinsoft@gmail.com> - 2012-07-05 22:48 -0700
  Re: Creating tables on the fly using --->   var tbl=document.createElement("table"); Bob <Go1369@yahoo.com> - 2012-07-06 08:21 -0700
    Re: Creating tables on the fly using --->   var tbl=document.createElement("table"); David Mark <dmark.cinsoft@gmail.com> - 2012-07-06 14:47 -0700

csiph-web