Support » Fixing WordPress » Links in table not formatted consistently

  • Resolved bobbear43


    see for example

    links in table on that page have no underline. before i edited the html and formatted each table row code exactly the same, some had underlines, some did not. wp also sticks <p></p> pairs in my code in tables inconsistently. a table row does not need <p></p>.

    links within text on a page are underlined.

    since i can fix the table to look like i want it to look, the problem is more the inconsistencies of displaying links.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Links are not underlined in your side navigation because of the following entry in your theme’s style.css file:

    a:link ,a:active ,a:visited {
    text-decoration: none;
    border: none;
    text-decoration: none;

    Removing “text-decoration:none;” (both times) will enable underlines on all links. To enable underlined links for just the content area of your page, add this code to style.css:

    entry a {
    text-decoration: underline;

    As I said above, at first some links in the side navigation table had underlines and some did not. I had already learned that WP does some quirky stuff with tables. Some of the html had unneeded <p></p> pairs. I removed all those and made sure all cells were formatted the same, meaning that the html code was arranged the same in each. And then no rows had underlined links. Links in plain text elsewhere do have underlines, including in other tables. IMO, quirky behavior.

    I am a programmer (retired) on multiple platforms. I do not know enough yet about PHP, CSS and WordPress, but I expect consistent behavior. The intent of the code may be as stated, however something is over-riding it at times. Just like the ghost lines I get in some tables that are neither in the source when viewed in the editor, or in the html when viewing source of a page displayed in a browser.

    What you are seeing is not the result of your code (HTML or PHP). Instead, it’s the result of CSS where the C stands for Cascading. What that means is that the definition of a style is based not only on the content that it is styling, nor just on the local context surrounding that style (<p></p>) but also on the larger context – particularly above it. Since every bit of code is embraced by larger containers, you may likely see <a> tags that are underlined when they’re in the main content container and not see them underlined in your sidebar. That’s because those are different containers and they scope the styles that apply.

    That’s why Felix suggested that if you only wanted underlining for your entries, you would create a CSS rule for entry a { because that’s the scope of the container that holds your articles (and side navigation). Now, if you want the underlining on your side navigation, but not the text of your articles, you’d have to add a style for that.

    Your CSS stylesheet is set to only underline links inside <p> tags.

    All the comments have added to my knowledge. Now I know what to expect. I actually don’t need underlines in my navigation tables, but now I know how to get them there. One is not supposed to need to mess with html…. but.

    I still see a problem that sometimes WP brackets table cell data with <p></p> and sometimes it does not. When there is extensive text, it is consistent. In the case of my table containing page titles, it was not consistent until I created a table in a separate file that I could copy into each page that needed it, in source html.

    We are using a table in a table for navigation in one column and text in another as we will eventually need more than one sidebar. We are trying to avoid getting complicated.

    WP needs a “container” that means “don’t mess with the code in this container.”

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Links in table not formatted consistently’ is closed to new replies.