Connecting Tech Pros Worldwide Help | Site Map

HTML tables

  #1  
Old March 4th, 2006, 05:25 PM
Netko
Guest
 
Posts: n/a
I'm new to php and i need ur help.

I have HTML table that is made form 4 columns and x rows.

I am wondering if there is any function that could get data from specific
cell into variable?

Example:

I have some variable $var and i would like to put data from some cell x,y
into that variable.

Can someone help me?

  #2  
Old March 4th, 2006, 07:15 PM
Carl Vondrick
Guest
 
Posts: n/a

re: HTML tables


Netko wrote:[color=blue]
> I'm new to php and i need ur help.
>
> I have HTML table that is made form 4 columns and x rows.
>
> I am wondering if there is any function that could get data from specific
> cell into variable?
>
> Example:
>
> I have some variable $var and i would like to put data from some cell x,y
> into that variable.
>
> Can someone help me?
>[/color]

Take a look at SimpleXML. As long as you are writing your pages in
XHTML, this should do exactly what you want.

--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
  #3  
Old March 4th, 2006, 07:25 PM
Richard Levasseur
Guest
 
Posts: n/a

re: HTML tables


Once you output the data to the browser, you can't access it using PHP.

If you want to change the table after its been outputted, use
javascript (and ask in the appropriate group)

If you are storing the table in an array, then to access a specific
cell you would just do:
$var = $table_data[2][1]; // this accesses row 3, column 2 (because
zero is the starting row or column)

  #4  
Old March 4th, 2006, 07:55 PM
Carl Vondrick
Guest
 
Posts: n/a

re: HTML tables


Richard Levasseur wrote:[color=blue]
> Once you output the data to the browser, you can't access it using PHP.[/color]

My assumption was that he wanted to access the HTML before it was
spitted to the browser (such as buffering).


--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
  #5  
Old March 4th, 2006, 08:05 PM
Netko
Guest
 
Posts: n/a

re: HTML tables


Datuma 4 Mar 2006 11:12:39 -0800, Richard Levasseur je napisao\la:
[color=blue]
> Once you output the data to the browser, you can't access it using PHP.
>
> If you want to change the table after its been outputted, use
> javascript (and ask in the appropriate group)[/color]

The table with data isnt output in browser, but it is html file on server.
But thx anyway, i think i got it with SimpleXML
  #6  
Old March 5th, 2006, 01:25 AM
Mladen Gogala
Guest
 
Posts: n/a

re: HTML tables


On Sat, 04 Mar 2006 18:08:24 +0100, Netko wrote:
[color=blue]
> I'm new to php and i need ur help.
>
> I have HTML table that is made form 4 columns and x rows.
>
> I am wondering if there is any function that could get data from
> specific cell into variable?
>
> Example:
>
> I have some variable $var and i would like to put data from some cell
> x,y into that variable.
>
> Can someone help me?[/color]


What you want is something like Perl HTML::TableParser module.
http://search.cpan.org/~djerius/HTML...TableParser.pm
Unfortunately, PHP doesn't have CPAN and you can try finding something on
http://www.phpclasses.org, write your own parser, which shouldn't be too
hard, or just write the whole darned thing in Perl.

--
http://www.mgogala.com

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML Tables Amie answers 2 August 19th, 2008 07:35 PM
HTML Tables Amie answers 4 August 19th, 2008 01:05 AM
Is this Ridiculous? Or not?--HTML Tables Zkidd answers 14 June 1st, 2007 12:45 PM
HTML Tables vs. CSS Layers - when function and form coincide www.gerardvignes.com answers 7 February 5th, 2007 11:45 AM
Help with HTML tables steve answers 4 March 29th, 2006 09:15 PM