Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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<><><>

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 hereThen 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 hereHope this helps,
-SN

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<><><>

![]() |
PHP- reading .jpg as .php...
|
Clear IE favorite unwant...
|

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