HTML tables

This is a discussion on HTML tables within the PHP Language forums, part of the PHP Programming Forums category; I'm new to php and i need ur help. I have HTML table that is made form 4 columns ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-04-2006
Netko
 
Posts: n/a
Default HTML tables

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?

Reply With Quote
  #2 (permalink)  
Old 03-04-2006
Carl Vondrick
 
Posts: n/a
Default Re: HTML tables

Netko wrote:
> 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?
>


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
Reply With Quote
  #3 (permalink)  
Old 03-04-2006
Richard Levasseur
 
Posts: n/a
Default 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)

Reply With Quote
  #4 (permalink)  
Old 03-04-2006
Carl Vondrick
 
Posts: n/a
Default Re: HTML tables

Richard Levasseur wrote:
> Once you output the data to the browser, you can't access it using PHP.


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
Reply With Quote
  #5 (permalink)  
Old 03-04-2006
Netko
 
Posts: n/a
Default Re: HTML tables

Datuma 4 Mar 2006 11:12:39 -0800, Richard Levasseur je napisao\la:

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


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
Reply With Quote
  #6 (permalink)  
Old 03-05-2006
Mladen Gogala
 
Posts: n/a
Default Re: HTML tables

On Sat, 04 Mar 2006 18:08:24 +0100, Netko wrote:

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



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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:06 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0