You are here: Re: How best to highlight an an item... « HTML « IT news, forums, messages
Re: How best to highlight an an item...

Posted by Norman Peelman on 08/22/07 10:31

dorayme wrote:
> I will be soon making up a page with a table of items. There will
> be a fair few rows. All not high, all tabular.
>
> People will be referencing parts of it via links that latch onto
> ids that will be placed on the <tr>s. But while this will narrow
> things down for folk, they will still see a whole lot of other
> stuff depending on the vertical size of their browser window. I
> was rather hoping there might be a neat way of also highlighting
> the row concerned, not necessarily literally the row, but
> something to mark it out as the one to be attended to. Need no
> help with the actual css, more with how to let the browser or
> server know which row needs the style.
>
> Can't think of any normal html/css way of doing this. Not
> particularly keen on a js way ...though I might consider it as it
> is sort of an extra bit of help and not fundamentally bad if
> anyone has it turned off.
>
> Anyone know of a php way perhaps? Do I have to go to alt.php. or
> alt.js.
>
> Can't I please just stay here? I like it here in spite of my bad
> treatment.
>
> I am reminded of that php stuff that I have used to stick in an
> id="current" on some list items depending on the html file being
> accessed. Perhaps it will all be clear by morning. But if anyone
> knows the way to go without blinding me with science... please,
> do spill the beans. <g>
>


I'd say this is best done server-side, that's where the code is
received to begin with. You simply need to output a different css style
for the desired row as you output the rows. Like:

$desired_row = isset($_GET['row']) ? $_GET['row'] : false;
if ($desired_row === false)
{ // do error checking, etc
}

//and then in your output code

for($loop = 0; $loop<=$num_rows; $loop++)
{
....
if ($loop == $desired_row)
{
//output an id, class for this row - define this class in the main
html/css file
// echo the row
....
}

outside of that you need to ask in a PHP group... no need for js, etc.

Norm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация