Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
table widths
Soundar Sweet
Ranch Hand
Posts: 31
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
In firefox. How to set width to all tables in a page to 100% using javascript? My requirement is after some operation, say a button click, all the table width need to set to 100%.
Soundar
Eric Pascarello
author
Posts: 15385
6
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
have you tried
document.getElementById("tableId").style.width = foo;
Eric
Soundar Sweet
Ranch Hand
Posts: 31
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Eric.
I need all table in my page should be set to width 100%. These tables are generated dynamically so i don't have the names.
Soundar
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Research getElementsByTagName().
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Karthik Srikanti
Greenhorn
Posts: 11
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
A sample would be
var tables = document.getElementsByTagName("table");
for(var i=0;i<tables.length;i++)
{
tables[i].width="100%";
}
[ March 03, 2007: Message edited by: Karthik Srikanti ]
{ SCJP, SCWCD, SCBCD, OCA (DBA) }
Hey cool! They got a blimp! But I have a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to make a page fit to a screen?
table with fixed column size?
HTML does not print properly - table width exceeding 100%?
Table width calculation
Netscape and Overflow Property
More...