473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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?

Mar 4 '06 #1
5 1242
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
Mar 4 '06 #2
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)

Mar 4 '06 #3
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
Mar 4 '06 #4
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
Mar 4 '06 #5
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

Mar 5 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

71
by: tomy_baseo | last post by:
I'm new to HTML and want to learn the basics by learning to code by hand (with the assistance of an HTML editor to eliminate repetitive tasks). Can anyone recommend a good, basic HTML editor that's...
72
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools...
21
by: BT | last post by:
I inherited a simple page that needs to be Strict HTML and I'm not very familiar with this standard. What I'm trying to do _should be_ pretty simple so I hope someone can point me in the right...
26
by: gswork | last post by:
i hadn't designed a web page from the ground up for about 9 years, then i was asked to do one. I'd dabbled with html and vaigly kept up with some of the developments but other than that i've been...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
136
by: 1001 Webs | last post by:
Every respected Web-authoring Guru says that. This is the era of table-less design, CSS code, XHTML compliant websites. Separate layout from content. There's no reason to use tables any more....
4
by: ink | last post by:
Hi all, I am trying to pull some financial data off of an HTML web page so that I can store it in a Database for Sorting and filtering. I have been thinking about this for some time and trying...
53
by: brave1979 | last post by:
Please check out my javascript library that allows you to create any layout for your web page, nested as deep as you like, adjusting to width and height of a browser window. You just describe it in...
3
by: codemannh | last post by:
I have been trying to figure out the best way to parse some chunks of html code that contain tables. I've been trying to do this with HTML::Parser and HTML::TokeParser and HTML::TokeParser::Simple,...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.