Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2001
    Location
    Arizona
    Posts
    550

    CSS - Link style inside a table

    Is it possible to put the style for hyperlinks inside a table? I would like any link made inside the table to get the style instead of having to make a separate style. Thanks!

    Code:
    <!-- Table for tabular data -->
    table.data {
    	width: 100%;
    	border: 1px;
    	border-collapse: collapse;
    	border-top: 1px solid #CCCCCC;
    	border-left: 1px solid #CCCCCC;
    	border-bottom: 0px solid #CCCCCC;
    	border-right: 0px solid #CCCCCC;
    	padding: 3px;
    	background-color: #FFFFFF;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 13px;
    	color: #000000;
    }
    table.data th {
    	background-color: #E5E5E5;
    	padding-top: 5px;
    	padding-left: 5px;
    	padding-right: 5px;
    	padding-bottom: 5px;
    	border-top: 0px solid #CCCCCC;
    	border-left: 0px solid #CCCCCC;
    	border-bottom: 1px solid #CCCCCC;
    	border-right: 1px solid #CCCCCC;
    }
    table.data td {
    	padding-top: 5px;
    	padding-left: 5px;
    	padding-right: 5px;
    	padding-bottom: 5px;
    	border-top: 0px solid #CCCCCC;
    	border-left: 0px solid #CCCCCC;
    	border-bottom: 1px solid #CCCCCC;
    	border-right: 1px solid #CCCCCC;
    }

  2. #2
    Join Date
    Feb 2008
    Posts
    80
    Just try it and see how it works

  3. #3
    Join Date
    Sep 2005
    Location
    Middle England
    Posts
    918
    You can only do it by adding some classes, something like this...

    table.data a:link {color: #0000FF;}
    table.data a:visited {color: #00FF00;}
    table.data a:hover {color: #FF0000;}
    table.data a:active {color: #FF00FF;}
    table.data a:focus {color: #FFFF00;}

  4. #4
    Join Date
    Dec 2001
    Location
    Arizona
    Posts
    550
    Oh okay, thanks. I was trying to add it to my current classes and wasn't seeing any result. Thanks!

  5. #5
    Join Date
    Feb 2008
    Posts
    80
    It should work

  6. #6
    Join Date
    Jul 2004
    Posts
    337
    The following example should work without the need to assign classes to your tables if ALL of your links in ALL of your tables are going to have the same formatting:
    HTML Code:
    table a:link, table a:visited, table a:active {
      color: #06c;
      text-decoration: none;
    }
    
    table a:hover {
      color: #06c;
      text-decoration: underline;
    }
    My woman left me..
    I've got no website..
    I've got no money..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •