HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Enlarging an entire table onclick of button
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
Light



Joined: 23 Oct 2009
Posts: 9

PostPosted: Fri Oct 23, 2009 1:18 am     Enlarging an entire table onclick of button Reply with quote

I have a webpage designed for class, involving a table with cells that are 4 columns and three rows in dimension.

My question is, I want the user to be able to click on a button and enlarge the entire table.

I would prefer not to use a "<a href=" if possible,
but I would entertain any and all ideas on how to code for such an enlargement.
sticks464



Joined: 31 Dec 2006
Posts: 2308

PostPosted: Fri Oct 23, 2009 6:47 am     Reply with quote

You can use javascript to enlarge and decrease size. Look at the numbers in this example and you should be able to get what you want. However it does not increase the size of text or other objects inside the table.

Put this in the head section
Code:
<script type="text/javascript">
function adjust(inp)
{
var vid=document.getElementById('table1'); // ID of your embed tag
if(inp.value.toLowerCase()=='enlarge')
{
inp.value='Decrease'; // Change the textbox's value to 'Decrease'.
vid.style.width='800px'; // Adjust the width to Npx.
vid.style.height='450px'; // Adjust the height to Npx.
}
else
{
inp.value='Enlarge'; // Change the textbox's value to 'Enlarge'.
vid.style.width='528px'; // Adjust the width to Npx.
vid.style.height='150px'; // Adjust the height to Npx.
}
}
</script>


table and button
Code:
<input type="button" value="Enlarge" onclick="adjust(this)">
<table id="table1" width="528" height="150" border="1" cellspacing="2" cellpadding="5">
  <tr>
    <td valign="top" valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
  </tr>
  <tr>
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
  </tr>
  <tr>
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
    <td valign="top">Some text</td valign="top">
  </tr>
</table>
Light



Joined: 23 Oct 2009
Posts: 9

PostPosted: Mon Oct 26, 2009 9:55 pm     Thankyou, and have another subject questions: Banners. Reply with quote

Thankyou, Stick,
I'll get back to you a day or two. Have mid term in Web class and need to check out the code for myself.

I'm onto a new subject. Banners that rotate using images(jpeg/gifs)
Been research the web and have not found anything that sufficiently explains the coding process for HTML. At this point i'm assuming a javascript application of some sort.
So, how do I begin to code for such? If i'm linking to another page is it HTML or CSS? If in either one are all of my images, say 5 to 10 are they in/on the same page? Questions like that. Also, timing is an obvious issue. I'm mostly curious, but not required for class. Thanks again. Light.
sticks464



Joined: 31 Dec 2006
Posts: 2308

PostPosted: Tue Oct 27, 2009 3:43 am     Reply with quote

Anything that moves, rotates, twinkles etc. is considered dynamic content and requires either javascript, php or ajax to make the effect. Depends on what you want to use as to what you can find. Some scripts let the images rotate on a timed setting and some rotate upon page load or reload.

Here's a nice javascript one.
Instructions here.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial