Computing.Net > Forums > Web Development > Making link change table properties

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Making link change table properties

Reply to Message Icon

Name: Tope
Date: April 3, 2004 at 14:59:41 Pacific
OS: WinXP
CPU/Ram: 2.53gHZ/512RAM
Comment:

I've been working on this for the last few hours and I can't seen to find a do-able solution. I making a main page right now that uses tables to separate things. Most sites do this, so I think everyone knows what I'm talking about. Out of 3-4 tables in the main table, there's one that I want to have no border when the main page is first loaded. Then I want to have a link that will put a border on this table and display something in it. Hopefully you can figure out what I mean. I've been trying to come up with a PHP script, but can't think of a way to do such a thing. I'm fairly new to web programming. I normally do local system stuff in C++. Anyway, if someone has an idea for a script that would do such a thing, I'd really appreciate the help.

<><><>Tope<><><>



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: April 4, 2004 at 10:12:45 Pacific
Reply:

Tope-
You have a couple of options here...But since you've been working on a PHP solution I'll start with that. Assuming that the page is a PHP script (or can be converted/renamed to be one), all you would need to do is have a link to the same script but with a query string:

//html stuff here
[A href='$PHP_SELF?print_border=true']click here to put a border[/a]
//more html stuff here

Then in the PHP script, before you output the table tag, do something like this:

if ($_GET["print_border"])
{
  $border="border=1";
}
else
  $border="";

print "<TABLE $border>";

//rest of the HTML stuff here

Pretty simple, huh?

An alternative solution would be to use javascript:
<script language="javascript">
function changeTable()
{
mytab=document.getElementById("myTable");
mytab.style="border-width: 5px;"
}
</script>
//html stuff here
[A href="javascript:changeTable()"]click here to change the table[/A]

<table id="myTable" border=0">
//rest of the html stuff here

Hope this helps,
-SN


0

Response Number 2
Name: Tope
Date: April 6, 2004 at 21:12:52 Pacific
Reply:

I haven't had internet access for the last few days so I haven't been able to respond. Those looked like they were going to work until I remembered that my tables aren't all on the same page. I have my main page as a table. Then there are 4 tables within that, and then 1 more table within one of those four. All those 4 tables are on separate pages. The link that I want to use this on is on one page, and I want it to change a table on the main page. I'm not sure how much of that makes sense to you. I have a menu that is on its own page. I want a link on that page to put a border on a table that's on the main index. Hope that last part clarified a little more than my first section. Thanks for the help.

<><><>Tope<><><>


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


PHP- reading .jpg as .php... Clear IE favorite unwant...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Making link change table properties

question on HTML tables www.computing.net/answers/webdevel/question-on-html-tables/1652.html

Links to Other Pages www.computing.net/answers/webdevel/links-to-other-pages/1554.html

IE 5.0 Mac/innerhtml www.computing.net/answers/webdevel/ie-50-macinnerhtml/451.html