Jump to content

Styles in Tables


Graeme

Recommended Posts

Hello All,

 

How can I style the text in a table the same as the rest of my text? I use

 

/* TEXT STYLES */

p {

margin: 5px; padding: 5px;

font-size: 1em;

line-height: 1.4em;

font-weight: normal;

color: #666;

}in my CSS and would like the same in my table.

 

Thank you a always,

 

Best wishes

Graeme

Link to comment
Share on other sites

Well you can add the <p> tags within the tables cells if you want. Otherwise, just give the table, tr or td a class or id just like you normally would for divs.

 

Examples:

 

Apply just the <p> tag only:

 

<table>
<tr>
<td><p>My content here</p></td>
</tr>
</table>

 

or...

 

Apply a class or id and create a set of styles just for tables:

<table class="mystyles">
<tr>
<td>My content here</td>
</tr>
</table>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...