php font format

How do I format this output please:
printf('<td><a href="?page=%1$s">Page %1$s</a></td>&nbsp;&nbsp;', $i);

ie colour the fonts or add images in place of text
doctorbillTechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Many ways, you can apply CSS to all table elements, all td elements, all anchor (a) elements.

Or you can assign an ID (likely best) + assign your CSS to an id.

You can also create a CSS class if the styling will apply to many elements.
0
gr8gonzoConsultantCommented:
To add color or styling, you'd use CSS styles. For example, to make it show white-on-black:

<a href="...." style="color:#fff; background-color:#000;">

To add images, you'd have to find the image and add it with an <img> tag.
0
Chris StanyonWebDevCommented:
To color the links you'll need to apply CSS to the <a> elements. Depending on your full HTML, there are a few ways you can do this.

With the a selector (all links in your page):

    a { color: green; }
    a:hover { color: red; }

With a class selector:

    printf('<td><a class="pagination" href="?page=%1$s">Page %1$s</a></td>&nbsp;&nbsp;', $i);
    .pagination { color: green; }
    .pagination:hover { color: red; }

With an ID on a parent element, such as your table:

    <table id="pagination">
    ...
    #pagination a { color: green; }
    #pagination a:hover { color: red; }

Not entirely sure what you mean by adding images. If you want an image in place of the text, you can just wrap it in your <a> tag:

printf('<td><a href="?page=%1$s"><img src="someImage.jpg" title="Page %1$s"></a></td>', $i);

FYI - THere's no need for the &nbsp elements in your code - they're outside of the <td> so will have no effect.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
doctorbillTechAuthor Commented:
Perfect - thanks all. I was trying to add the style in the <td> element instead of the <a tag
0
doctorbillTechAuthor Commented:
Thanks all
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.